/* Dr Rucha Clinic - Shared Styles */

:root {
    /* Light mode colors */
    --primary-green: #10b981;
    --primary-green-light: #34d399;
    --primary-green-dark: #059669;
    --success-green: #22c55e;
    --accent-emerald: #10b981;
    --warning-orange: #f59e0b;
    --danger-red: #ef4444;
    
    /* Light mode backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-card: #ffffff;
    --bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    
    /* Light mode text */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --text-accent: #10b981;
    
    /* Light mode borders */
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;
    --border-accent: #10b981;
    
    /* Light mode shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark mode backgrounds */
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --bg-card: #1e293b;
        --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        
        /* Dark mode text */
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-tertiary: #94a3b8;
        --text-accent: #34d399;
        
        /* Dark mode borders */
        --border-primary: #334155;
        --border-secondary: #475569;
        --border-accent: #10b981;
        
        /* Dark mode shadows */
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    }
}



/* Force dark mode class */
.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-accent: #34d399;
    --border-primary: #334155;
    --border-secondary: #475569;
    --border-accent: #10b981;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Base Styles */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.hidden { display: none !important; }
.icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-secondary);
    border-top: 3px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Card Components */
.modern-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}

.modern-card-sm {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

/* Logo Styles - Optimized for square logo */
.clinic-logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-primary);
    overflow: hidden;
}

.clinic-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clinic-logo-large {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-green);
    overflow: hidden;
}

.clinic-logo-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clinic-logo-square {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-primary);
    overflow: hidden;
}

.clinic-logo-square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Header logo variant */
.clinic-logo-header {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-primary);
}

.clinic-logo-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Button Components */
.btn-primary {
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--primary-green-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning-orange);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-danger {
    background: var(--danger-red);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* Input Components */
.modern-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    width: 100%;
    transition: all 0.2s ease;
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.modern-input::placeholder {
    color: var(--text-tertiary);
}

/* Metric Cards */
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

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

.metric-card.pending {
    border-left: 4px solid var(--warning-orange);
}

.metric-card.reconciled {
    border-left: 4px solid var(--success-green);
}

/* Filter Buttons */
.filter-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 14px;
    cursor: pointer;
}

.filter-btn:hover {
    background: var(--bg-tertiary);
}

.filter-btn.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

/* Table Styles */
.modern-table {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-primary);
}

.modern-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 16px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modern-table td {
    padding: 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-primary);
}

.modern-table tr:hover td {
    background: var(--bg-secondary);
}

/* Status Indicators */
.status-positive {
    color: var(--success-green);
    background: rgba(34, 197, 94, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.status-warning {
    color: var(--warning-orange);
    background: rgba(245, 158, 11, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.status-danger {
    color: var(--danger-red);
    background: rgba(239, 68, 68, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.status-neutral {
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 50px;
    padding: 8px 12px;
    box-shadow: var(--shadow-md);
}

/* Tab Styles */
.tab-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px 8px 0 0;
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: none;
    cursor: pointer;
}

.tab-btn:hover {
    background: var(--bg-tertiary);
}

.tab-btn.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.tab-content {
    border: 1px solid var(--border-primary);
    border-radius: 0 16px 16px 16px;
    background: var(--bg-card);
}

/* Responsive Grid */
.dashboard-grid {
    display: grid;
    gap: 24px;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Utility Classes */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}