/* index.css - Complete with Dark/Light Mode and Toast Notifications */
:root {
    /* Light Mode Variables */
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --header-bg: #ffffff;
    --nav-bg: #f0f0f0;
    --result-bg: #f8f9fa;
    --success-bg: #e8f5e9;
    --warning-bg: #fff3cd;
    --shadow: 0 5px 15px rgba(0,0,0,0.1);
    --shadow-hover: 0 10px 25px rgba(0,0,0,0.15);
    --button-gradient: linear-gradient(135deg, #0d8f94, #0b6b6f);
}

[data-theme="dark"] {
    /* Dark Mode Variables */
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-card: #2d2d3a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #4a4a5a;
    --header-bg: #1e1e2a;
    --nav-bg: #3a3a4a;
    --result-bg: #252530;
    --success-bg: #1a3a1a;
    --warning-bg: #3a2a1a;
    --shadow: 0 5px 15px rgba(0,0,0,0.3);
    --shadow-hover: 0 10px 25px rgba(0,0,0,0.4);
    --button-gradient: linear-gradient(135deg, #0d8f94, #0b6b6f);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: 'Poppins', 'Roboto', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Header with user info */
.app-header {
    background: var(--header-bg);
    padding: 15px 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    color: #0d8f94;
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0d8f94;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.subscription-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.subscribed {
    background: #4caf50;
    color: white;
}

.not-subscribed {
    background: #ff9800;
    color: white;
}

.login-btn, .logout-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    width: auto;
    margin: 0;
    font-size: 14px;
}

.login-btn {
    background: #4285f4;
    color: white;
}

.login-btn:hover {
    background: #3367d6;
    transform: none;
}

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

.logout-btn:hover {
    background: #c82333;
    transform: none;
}

/* Dark/Light Mode Toggle */
.theme-toggle {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 30px;
    padding: 5px;
    cursor: pointer;
    display: flex;
    gap: 5px;
    width: auto;
    margin: 0;
}

.theme-toggle button {
    padding: 5px 12px;
    margin: 0;
    font-size: 14px;
    background: transparent;
    color: var(--text-primary);
    width: auto;
}

.theme-toggle button.active {
    background: #0d8f94;
    color: white;
}

.theme-toggle button:hover {
    transform: none;
    background: rgba(13, 143, 148, 0.2);
}

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

/* Cards and sections */
.card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card h2 {
    color: #0d8f94;
    margin-bottom: 20px;
    border-bottom: 2px solid #0d8f94;
    padding-bottom: 10px;
}

/* Navigation tabs */
.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--bg-card);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.nav-tab {
    padding: 10px 20px;
    background: var(--nav-bg);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    color: var(--text-primary);
}

.nav-tab.active {
    background: #0d8f94;
    color: white;
}

.nav-tab:hover {
    background: #0d8f94;
    color: white;
}

/* Form elements */
select, input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    transition: border-color 0.3s;
    background: var(--bg-card);
    color: var(--text-primary);
}

select:focus, input:focus {
    outline: none;
    border-color: #0d8f94;
}

button {
    width: 100%;
    padding: 12px;
    background: var(--button-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

button:hover {
    transform: scale(1.02);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Results display */
.result-box {
    background: var(--result-bg);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    border-left: 4px solid #0d8f94;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
    color: var(--text-primary);
}

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

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 15px;
    max-width: 90%;
    width: 500px;
    max-height: 80%;
    overflow-y: auto;
    color: var(--text-primary);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.close-modal {
    cursor: pointer;
    font-size: 24px;
    color: var(--text-secondary);
}

.close-modal:hover {
    color: var(--text-primary);
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    flex: 1;
    background: #6c757d;
}

.action-btn.pdf {
    background: #dc3545;
}

.action-btn.summary {
    background: #28a745;
}

/* Upgrade banner */
.pro-upgrade-banner {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    margin-top: 15px;
    cursor: pointer;
    transition: transform 0.3s;
}

.pro-upgrade-banner:hover {
    transform: translateY(-2px);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.toast {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
    min-width: 280px;
}

.toast.success {
    border-left-color: #4caf50;
}

.toast.success .toast-icon {
    color: #4caf50;
}

.toast.error {
    border-left-color: #f44336;
}

.toast.error .toast-icon {
    color: #f44336;
}

.toast.info {
    border-left-color: #2196f3;
}

.toast.info .toast-icon {
    color: #2196f3;
}

.toast.warning {
    border-left-color: #ff9800;
}

.toast.warning .toast-icon {
    color: #ff9800;
}

.toast-icon {
    font-size: 24px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 14px;
    opacity: 0.9;
}

.toast-close {
    cursor: pointer;
    font-size: 18px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-exit {
    animation: slideOut 0.3s ease forwards;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0d8f94;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Calculator tabs */
.calc-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.calc-tab {
    flex: 1;
    background: var(--nav-bg);
    color: var(--text-primary);
}

.calc-tab.active {
    background: #0d8f94;
    color: white;
}

/* Google login button */
.google-login-btn {
    background: white;
    color: #333;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.google-login-btn:hover {
    border-color: #0d8f94;
    background: white;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .user-info {
        justify-content: center;
    }
    
    .card {
        padding: 15px;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .theme-toggle {
        margin-top: 10px;
    }
    
    .calc-tabs {
        flex-direction: column;
    }
}