/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Authentication Pages */
.auth-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 50px auto;
    text-align: center;
}

.auth-card h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2rem;
}

.auth-form {
    text-align: right;
}

.form-group {
    margin-bottom: 20px;
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-links a:hover {
    text-decoration: underline;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
    text-align: right;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
    text-align: right;
}

/* Dashboard Styles */
.dashboard-header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-header h1 {
    color: #333;
    margin: 0;
    font-size: 1.8rem;
}

.dashboard-content {
    animation: fadeIn 0.5s ease-in;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    color: #666;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.amount {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.amount.paid {
    color: #28a745;
}

.amount.remaining {
    color: #ffc107;
}

.amount.overpaid {
    color: #dc3545;
}

.section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.form {
    max-width: 500px;
}

.form .form-group {
    margin-bottom: 20px;
}

.search-filter {
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

.search-input,
.category-filter {
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
}

.search-input {
    flex: 2;
}

.category-filter {
    flex: 1;
}

.payment-history {
    margin-top: 20px;
}

.payment-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.payment-table th,
.payment-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #e1e5e9;
}

.payment-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.payment-table tr:hover {
    background: #f8f9fa;
}

.payment-table .amount {
    font-weight: bold;
    color: #333;
}

.payment-table .actions {
    display: flex;
    gap: 5px;
    justify-content: flex-start;
}

.category-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.category-badge.مصاريف {
    background: #dc3545;
}

.category-badge.دخل {
    background: #28a745;
}

.category-badge.قرض {
    background: #ffc107;
    color: #333;
}

.category-badge.توفير {
    background: #17a2b8;
}

.category-badge.أخرى {
    background: #6c757d;
}

.no-payments {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 10px;
}

.strength-bar {
    width: 100%;
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.strength-fill.weak {
    background: #dc3545;
    width: 25%;
}

.strength-fill.fair {
    background: #ffc107;
    width: 50%;
}

.strength-fill.good {
    background: #17a2b8;
    width: 75%;
}

.strength-fill.strong {
    background: #28a745;
    width: 100%;
}

.strength-text {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.password-match {
    margin-top: 5px;
    font-size: 12px;
    font-weight: 600;
}

.password-match.match {
    color: #28a745;
}

.password-match.no-match {
    color: #dc3545;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .auth-card {
        margin: 20px auto;
        padding: 30px 20px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .header-actions {
        justify-content: center;
        width: 100%;
    }
    
    .header-actions .btn {
        flex: 1;
        min-width: 120px;
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .card h3 {
        font-size: 1rem;
    }
    
    .amount {
        font-size: 1.5rem;
    }
    
    .section {
        padding: 20px;
    }
    
    .section h2 {
        font-size: 1.3rem;
    }
    
    .search-filter {
        padding: 15px;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-input,
    .category-filter {
        width: 100%;
        min-width: auto;
    }
    
    .payment-table {
        font-size: 14px;
    }
    
    .payment-table th,
    .payment-table td {
        padding: 10px 8px;
    }
    
    .payment-table .actions {
        flex-direction: column;
        gap: 3px;
    }
    
    .payment-table .actions .btn {
        font-size: 12px;
        padding: 5px 8px;
    }
    
    .category-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .dashboard-header {
        padding: 15px;
    }
    
    .dashboard-header h1 {
        font-size: 1.3rem;
    }
    
    .card {
        padding: 15px;
    }
    
    .section {
        padding: 15px;
    }
    
    .section h2 {
        font-size: 1.2rem;
    }
    
    .form {
        max-width: 100%;
    }
    
    .form-group input,
    .form-group select {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .btn {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .payment-table {
        font-size: 12px;
    }
    
    .payment-table th,
    .payment-table td {
        padding: 8px 5px;
    }
    
    .payment-table .actions .btn {
        font-size: 10px;
        padding: 4px 6px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .section {
    animation: fadeIn 0.5s ease-in;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Notifications */
.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease-out;
    border-right: 4px solid #667eea;
}

.notification.success {
    border-right-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.notification.warning {
    border-right-color: #ffc107;
    background: #fff3cd;
    color: #856404;
}

.notification.error {
    border-right-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.notification.info {
    border-right-color: #17a2b8;
    background: #d1ecf1;
    color: #0c5460;
}

.notification-message {
    flex: 1;
    margin-right: 10px;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Dark Mode Styles */
.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
}

.dark-mode .auth-card,
.dark-mode .dashboard-header,
.dark-mode .card,
.dark-mode .section {
    background: #2d3748;
    color: #e0e0e0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.dark-mode .auth-card h1,
.dark-mode .dashboard-header h1,
.dark-mode .section h2,
.dark-mode .card h3 {
    color: #f7fafc;
}

.dark-mode .form-group label {
    color: #cbd5e0;
}

.dark-mode .form-group input,
.dark-mode .form-group select {
    background: #4a5568;
    border-color: #718096;
    color: #e0e0e0;
}

.dark-mode .form-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.dark-mode .search-filter {
    background: #4a5568;
}

.dark-mode .payment-table {
    background: #2d3748;
    color: #e0e0e0;
}

.dark-mode .payment-table th {
    background: #4a5568;
    color: #f7fafc;
}

.dark-mode .payment-table tr:hover {
    background: #4a5568;
}

.dark-mode .payment-table td {
    border-bottom-color: #4a5568;
}

.dark-mode .no-payments {
    background: #4a5568;
    color: #cbd5e0;
}

.dark-mode .amount {
    color: #f7fafc;
}

.dark-mode .amount.paid {
    color: #68d391;
}

.dark-mode .amount.remaining {
    color: #f6e05e;
}

.dark-mode .amount.overpaid {
    color: #fc8181;
}

.dark-mode .btn-secondary {
    background: #4a5568;
    color: #e0e0e0;
}

.dark-mode .btn-secondary:hover {
    background: #718096;
}

.dark-mode .error-message {
    background: #742a2a;
    color: #feb2b2;
    border-color: #c53030;
}

.dark-mode .success-message {
    background: #22543d;
    color: #9ae6b4;
    border-color: #38a169;
}

.dark-mode .strength-bar {
    background: #4a5568;
}

.dark-mode .strength-text {
    color: #cbd5e0;
}

.dark-mode .password-match {
    color: #cbd5e0;
}

.dark-mode .password-match.match {
    color: #68d391;
}

.dark-mode .password-match.no-match {
    color: #fc8181;
}

/* Dark mode scrollbar */
.dark-mode ::-webkit-scrollbar-track {
    background: #2d3748;
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: #4a5568;
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Dark mode notifications */
.dark-mode .notification {
    background: #2d3748;
    color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-mode .notification.success {
    background: #22543d;
    color: #9ae6b4;
    border-right-color: #68d391;
}

.dark-mode .notification.warning {
    background: #744210;
    color: #f6e05e;
    border-right-color: #f6e05e;
}

.dark-mode .notification.error {
    background: #742a2a;
    color: #feb2b2;
    border-right-color: #fc8181;
}

.dark-mode .notification.info {
    background: #2a4365;
    color: #90cdf4;
    border-right-color: #63b3ed;
}

/* Charts and Reports */
.chart-container {
    position: relative;
    height: 400px;
    margin: 20px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h4 {
    color: #666;
    margin-bottom: 10px;
    font-size: 1rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-date {
    color: #999;
    font-size: 0.9rem;
}

.category-stats {
    margin-top: 20px;
}

.category-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.category-amount {
    font-weight: bold;
    color: #333;
}

.category-bar {
    flex: 2;
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    margin: 0 15px;
    overflow: hidden;
}

.category-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.category-percentage {
    font-weight: bold;
    color: #666;
    min-width: 50px;
    text-align: left;
}

/* Dark mode for reports */
.dark-mode .stat-card {
    background: #2d3748;
    color: #e0e0e0;
}

.dark-mode .stat-card h4 {
    color: #cbd5e0;
}

.dark-mode .stat-value {
    color: #f7fafc;
}

.dark-mode .stat-date {
    color: #a0aec0;
}

.dark-mode .category-stat {
    background: #4a5568;
}

.dark-mode .category-amount {
    color: #e0e0e0;
}

.dark-mode .category-percentage {
    color: #cbd5e0;
}

.dark-mode .category-bar {
    background: #4a5568;
}

/* Mobile responsiveness for notifications */
@media (max-width: 768px) {
    .notifications {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .category-stat {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .category-info {
        justify-content: center;
    }
    
    .category-bar {
        width: 100%;
        margin: 10px 0;
    }
} 