/* Shared Styles for Deductably User Pages */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables - Only set defaults, don't override if already defined */
:root {
    /* Deductably brand green (#10B981) - PRIMARY COLOR */
    --primary: #10B981;
    --primary-dark: #059669;
    --primary-light: #34D399;
    
    /* Color aliases for compatibility */
    --color-primary: #10B981;
    --color-primary-dark: #059669;
    --color-primary-light: #34D399;
    
    /* Secondary colors */
    --accent: #F59E0B;
    --secondary: #F59E0B;
    --tertiary: #3B82F6;
    
    /* Text colors */
    --text-dark: #1F2937;
    --text-light: #6B7280;
    --color-on-surface: #1F2937;
    --color-on-surface-variant: #6B7280;
    
    /* Background colors */
    --background: #F9FAFB;
    --background-light: #F9FAFB;
    --color-surface: #FFFFFF;
    --color-background: #F9FAFB;
    
    /* Border colors */
    --border: #E5E7EB;
    --color-outline-variant: #E5E7EB;
}

/* For pages that already define these, they will override the above */
/* This ensures landing page colors are preserved */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-dark);
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-dark);
    text-decoration: none;
}

.logo-icon {
    font-size: 2rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
}

.user-email {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 80px;
    width: 250px;
    height: calc(100vh - 80px);
    background: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    padding: 2rem 0;
    overflow-y: auto;
    z-index: 90;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--background);
    border-left-color: var(--primary);
}

.nav-item.active {
    background: #E8F5E9;
    border-left-color: var(--primary);
    color: var(--primary-dark);
    font-weight: 600;
}

.nav-item-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.error {
    background: #FFEBEE;
    color: #C62828;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Slide Down Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-message {
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.button-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    opacity: 0;
    transform: translateX(400px);
    animation: slideIn 0.3s ease forwards;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

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

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-dark);
}

.toast-success {
    border-left: 4px solid #10B981;
}

.toast-success .toast-icon {
    color: #10B981;
}

.toast-error {
    border-left: 4px solid #EF4444;
}

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

.toast-warning {
    border-left: 4px solid #F59E0B;
}

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

.toast-info {
    border-left: 4px solid #3B82F6;
}

.toast-info .toast-icon {
    color: #3B82F6;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.empty-state-message {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-action {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.empty-state-action:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Form Validation */
.field-invalid {
    border-color: #EF4444 !important;
}

.field-valid {
    border-color: #10B981 !important;
}

.field-error {
    color: #EF4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Smooth Transitions - Only apply to specific elements, not all */
/* This prevents interfering with existing animations */
button, a, .nav-item, .btn, .toast, .empty-state-action {
    transition: all 0.2s ease;
}

/* Consistent Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: var(--background);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .page-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
    }
    
    .user-details {
        display: none;
    }
}

