/* ================================================
   3DScenario Platform - Design System
   Modern, Premium UI with Glassmorphism
   ================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
    /* Primary palette - Emerald Green (Yeşil Dönüşüm & Sağlık) */
    --primary: #059669;
    --primary-light: #10b981;
    --primary-dark: #047857;
    --primary-glow: rgba(5, 150, 105, 0.2);

    /* Accent - Teal for secondary */
    --accent: #0d9488;
    --accent-light: #14b8a6;
    --accent-dark: #0f766e;

    /* Warm accent */
    --warm: #d97706;
    --warm-light: #f59e0b;

    /* Danger */
    --danger: #dc2626;
    --danger-light: #ef4444;

    /* Background - Light, Clean Theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;

    /* Glass effect (adapted for light mode) */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.05);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --glass-blur: blur(12px);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    /* Borders */
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.04);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
}

/* ---- Reset ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(5, 150, 105, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(13, 148, 136, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(34, 197, 94, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Container ---- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    position: relative;
    z-index: 1;
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-lg);
    position: relative;
    z-index: 1;
}

/* ---- Glass Card ---- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: var(--space-lg);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.glass-card.no-hover:hover {
    transform: none;
    box-shadow: var(--glass-shadow);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: translateY(-1px);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    transform: translateY(-1px);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-light), var(--danger));
    transform: translateY(-1px);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warm), #d97706);
    color: var(--text-inverse);
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--warm-light), var(--warm));
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--glass-bg);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: 16px 32px;
    font-size: var(--font-size-base);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

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

/* ---- Form Elements ---- */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-tertiary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
}

.form-text {
    display: block;
    margin-top: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.form-error {
    display: block;
    margin-top: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--danger);
}

/* Input group */
.input-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
}

.input-group-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 1;
}

.input-group-icon + .form-control {
    padding-left: 44px;
}

.input-group-append {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* Checkbox and Radio */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    margin-top: 2px;
}

.form-check input[type="radio"] {
    border-radius: 50%;
}

.form-check input[type="checkbox"]:checked,
.form-check input[type="radio"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-check input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.form-check input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.form-check-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ---- Alerts / Flash Messages ---- */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: var(--font-size-sm);
    animation: slideDown 0.3s ease;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-light);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger-light);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warm-light);
}

.alert-info {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.3);
    color: var(--primary-light);
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    font-size: 18px;
}

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

/* ---- Badge ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    line-height: 1;
}

.badge-primary {
    background: rgba(14, 165, 233, 0.15);
    color: var(--primary-light);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-light);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-light);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warm-light);
}

.badge-neutral {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

/* ---- Tables ---- */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

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

thead th {
    background: var(--bg-tertiary);
    padding: 14px 16px;
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: 14px 16px;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: rgba(5, 150, 105, 0.02);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ---- Grid System ---- */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

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

@media (max-width: 640px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .container, .container-fluid { padding: 0 var(--space-md); }
}

/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--space-md);
    border-radius: var(--radius-md);
    display: block;
    position: relative;
}

.table-responsive table {
    min-width: 800px; /* Force minimum width to trigger scroll on mobile */
    width: 100%;
    border-collapse: collapse;
}

/* Ensure glass-cards allow their children to scroll if needed */
.glass-card.no-overflow-hidden {
    overflow: visible;
}

/* ---- Flexbox Helpers ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ---- Stat Card ---- */
.stat-card {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.stat-card.stat-primary::before { background: var(--primary); }
.stat-card.stat-success::before { background: var(--accent); }
.stat-card.stat-warning::before { background: var(--warm); }
.stat-card.stat-danger::before { background: var(--danger); }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: var(--space-md);
}

.stat-primary .stat-icon { background: rgba(14, 165, 233, 0.15); color: var(--primary); }
.stat-success .stat-icon { background: rgba(16, 185, 129, 0.15); color: var(--accent); }
.stat-warning .stat-icon { background: rgba(245, 158, 11, 0.15); color: var(--warm); }
.stat-danger .stat-icon { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.stat-card .stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.stat-card .stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    display: none; /* Hidden by default */
    flex-direction: column;
}

.modal-overlay.active .modal {
    display: flex; /* Show only when overlay is active */
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: var(--font-size-lg);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 18px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--border);
}

/* ---- Toast Notifications ---- */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    animation: slideRight 0.3s ease;
    min-width: 300px;
    max-width: 450px;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--accent); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warm); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
    margin-bottom: 2px;
}

.toast-message {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

/* ---- Avatar ---- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

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

.avatar-sm { width: 32px; height: 32px; font-size: var(--font-size-xs); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--font-size-lg); }
.avatar-xl { width: 80px; height: 80px; font-size: var(--font-size-2xl); }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-xl);
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.pagination a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

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

/* ---- Loading Spinner ---- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

/* ---- Progress Bar ---- */
.progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width var(--transition-slow);
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: var(--space-xs);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-xl);
    overflow-x: auto;
}

.tab {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

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

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ---- Tooltip ---- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 6px 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ---- Utility Classes ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-lg { font-size: var(--font-size-lg); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warm); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.hidden { display: none !important; }
.relative { position: relative; }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    :root {
        --space-lg: 16px;
        --space-xl: 24px;
    }

    h1 { font-size: var(--font-size-2xl); }
    h2 { font-size: var(--font-size-xl); }
    h3 { font-size: var(--font-size-lg); }

    .container {
        padding: 0 var(--space-md);
    }

    .modal {
        max-width: 100%;
        margin: var(--space-md);
        max-height: 90vh;
    }

    .toast {
        min-width: auto;
        max-width: calc(100vw - 32px);
    }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- Selection ---- */
::selection {
    background: var(--primary);
    color: white;
}

/* ---- Dropdown Menus ---- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-card);
    min-width: 160px;
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    z-index: 100;
    padding: var(--space-xs) 0;
    margin-top: var(--space-xs);
    animation: fadeIn 0.2s ease;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}


/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: var(--space-md);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-lg);
}

.tab-btn {
    padding: var(--space-sm) var(--space-md);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
}

.tab-content {
    display: none;
}

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

.progress-mini {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.progress-bar-mini {
    height: 100%;
    background: var(--primary);
}
