/* 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;
    direction: rtl;
    line-height: 1.6;
}

/* Container Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 0;
    color: white;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.3rem;
    opacity: 0.9;
}

/* Authentication Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 450px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 10px;
}

.auth-header p {
    color: #666;
    font-size: 1.1rem;
}

.auth-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-full {
    width: 100%;
}

/* Auth Section */
.auth-section {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.auth-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.auth-footer {
    text-align: center;
}

.auth-footer p {
    margin-bottom: 15px;
    color: #666;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-block;
    margin-top: 10px;
    color: #999;
    text-decoration: none;
}

.back-link:hover {
    color: #667eea;
}

.auth-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
}

/* Features Section */
.features {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.features h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
}

.feature-card h3 {
    color: #333;
    margin-bottom: 15px;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

/* Dashboard Styles */
.dashboard-container {
    min-height: 100vh;
    background: #f8f9fa;
}

.dashboard-header {
    background: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    color: #333;
    font-size: 1.8rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    color: #666;
    font-size: 0.9rem;
}

.dashboard-nav {
    background: white;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.nav-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    list-style: none;
    gap: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: all 0.3s;
}

.nav-link:hover {
    background: #f8f9fa;
    color: #333;
}

.nav-link.active {
    background: #667eea;
    color: white;
}

.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

.page-content h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2rem;
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.balance-info h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 700;
}

.balance-icon {
    font-size: 4rem;
    opacity: 0.7;
}

/* Wallet Actions */
.wallet-actions {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

/* Transactions */
.recent-transactions h3 {
    color: #333;
    margin-bottom: 20px;
}

.transactions-list {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-info {
    flex: 1;
}

.transaction-reason {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.transaction-date {
    color: #666;
    font-size: 0.9rem;
}

.transaction-amount {
    font-weight: 700;
    font-size: 1.1rem;
}

.transaction-amount.deposit {
    color: #28a745;
}

.transaction-amount.withdraw {
    color: #dc3545;
}

/* Expenses Table */
.expenses-filters {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: end;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    color: #333;
}

.expenses-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.expenses-table table {
    width: 100%;
    border-collapse: collapse;
}

.expenses-table th,
.expenses-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
}

.expenses-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.transaction-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.transaction-type.deposit {
    background: #d4edda;
    color: #155724;
}

.transaction-type.withdraw {
    background: #f8d7da;
    color: #721c24;
}

.amount.deposit {
    color: #28a745;
}

.amount.withdraw {
    color: #dc3545;
}

/* Goal Card */
.goal-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.goal-info h3 {
    color: #333;
    margin-bottom: 10px;
}

.goal-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.goal-amount.collected {
    color: #28a745;
}

/* Progress Bar */
.progress-bar {
    background: #e9ecef;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-percentage {
    text-align: center;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #333;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: #666;
    padding: 40px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .auth-card {
        padding: 30px 20px;
    }
    
    .auth-buttons {
        flex-direction: column;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-list {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .balance-card {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .balance-amount {
        font-size: 2rem;
    }
    
    .wallet-actions {
        flex-direction: column;
    }
    
    .goal-card {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .expenses-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .expenses-table {
        font-size: 0.9rem;
    }
    
    .expenses-table th,
    .expenses-table td {
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .page-content h2 {
        font-size: 1.5rem;
    }
    
    .balance-amount {
        font-size: 1.8rem;
    }
    
    .goal-amount {
        font-size: 1.5rem;
    }
    
    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .transaction-amount {
        align-self: flex-end;
    }
}

/* Database Status Styles */
.database-status {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.database-status:hover {
    background: rgba(255, 255, 255, 0.2);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-indicator.offline {
    background: #dc3545;
    animation: none;
}

.status-indicator.syncing {
    background: #ffc107;
    animation: blink 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}
