/* Import Google Fonts (must be at the very top per CSS spec) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Category transaction dropdown styles */
.category-transactions {
    display: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.category-transactions.show {
    display: block !important;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 300px;
    }
}

/* Make category headers clickable */
.category-stats[data-action="toggle-category"] {
    cursor: pointer !important;
    transition: all 0.2s ease;
}

.category-stats[data-action="toggle-category"]:hover {
    background: rgba(255,255,255,0.05) !important;
    border-radius: 8px;
    transform: translateY(-1px);
}

/* CRITICAL: Force ChatGPT theme background to show through */
body {
    background: #212121 !important;
    min-height: 100vh !important;
    color: #d1d5db !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    position: relative !important;
    overflow-x: hidden;
}

/* Google button theming to match dark glass style */
.google-btn {
  background: rgba(40,40,46,0.6) !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px !important;
  border-radius: 8px !important;
  backdrop-filter: blur(10px);
}
.google-btn:hover {
  background: rgba(50,50,58,0.75) !important;
  border-color: rgba(255,255,255,0.18) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35) !important;
}
.google-btn .google-icon {
  filter: brightness(1.1);
}

/* CRITICAL: Force ChatGPT theme colorful orbs to show */
body::before {
    content: '' !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: 
        /* Pink/Red orb */
        radial-gradient(circle at 85% 20%, rgba(236, 72, 153, 0.15) 0%, transparent 25%),
        /* Yellow/Orange orb */
        radial-gradient(circle at 15% 70%, rgba(250, 204, 21, 0.12) 0%, transparent 30%),
        /* Green orb */
        radial-gradient(circle at 65% 85%, rgba(34, 197, 94, 0.1) 0%, transparent 25%),
        /* Purple orb */
        radial-gradient(circle at 25% 25%, rgba(168, 85, 247, 0.12) 0%, transparent 30%),
        /* Blue orb */
        radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        /* Additional pink */
        radial-gradient(circle at 90% 70%, rgba(244, 114, 182, 0.08) 0%, transparent 25%),
        /* Dark base gradient */
        linear-gradient(180deg, #212121 0%, #1a1a1a 50%, #171717 100%) !important;
    pointer-events: none !important;
    z-index: 0 !important;
}

/* CRITICAL: Force ChatGPT theme glassmorphism on all content */
.card, .period-selector, .metric-card, .chart-container, .monthly-breakdown, 
.detailed-breakdown, .income-breakdown, .financial-insights, 
.financial-summary-section, .report-actions, .profile-reports-section,
.page-header, .lookback-display, .custom-date-range, .no-data-message,
.feature-card, .auth-container, .alert, .navbar, .container > .row > .col,
.main-content, .sidebar, .content-wrapper, .form-container, .settings-card,
.subscription-card, .profile-card, .calculator-card, .guide-card {
    background: rgba(40, 40, 46, 0.5) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    position: relative;
    z-index: 1;
}

/* CRITICAL: Force ChatGPT theme text colors */
h1, h2, h3, h4, h5, h6, p, span, div, label, a, li, td, th, strong, small {
    color: #d1d5db !important;
}

/* Global minimal overlay remover (opt-in via class) */
.no-overlay .card,
.no-overlay .card-header,
.no-overlay .card-body,
.no-overlay .bg-gradient-primary,
.no-overlay .bg-gradient-secondary {
  background: transparent !important;
  backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}

.no-overlay .page-header {
  background: transparent !important;
  /* Keep the elegant rectangle border consistent with index */
  border: 1px solid rgba(227, 230, 240, 0.3) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

.no-overlay .content-area {
  background: transparent !important;
}

/* Global removal of breadcrumbs */
.breadcrumb,
.breadcrumbs,
[aria-label="breadcrumb"],
.account-breadcrumbs,
#account-breadcrumbs {
  display: none !important;
  visibility: hidden !important;
}

.no-overlay .btn-outline-primary,
.no-overlay .btn-outline-secondary,
.no-overlay .btn-outline-danger,
.no-overlay .btn-outline-info {
  background: transparent !important;
}

.no-overlay .upload-zone,
.no-overlay .invoice-upload-zone,
.no-overlay .bank-upload-zone {
  background: transparent !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

.no-overlay .badge.bg-light.text-dark {
  background: rgba(255,255,255,0.15) !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
}
/* =================================== */
/* MAIN STYLESHEET - ESSENTIAL STYLES */
/* =================================== */

/* Design System Variables */
:root {
    --primary-50: #f8fafc;
    --primary-100: #f1f5f9;
    --primary-200: #e2e8f0;
    --primary-300: #cbd5e1;
    --primary-400: #94a3b8;
    --primary-500: #64748b;
    --primary-600: #475569;
    --primary-700: #334155;
    --primary-800: #1e293b;
    --primary-900: #0f172a;
    
    --accent-blue: #3b82f6;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    --info: #2563eb;
    
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    /* Background removed to allow ChatGPT theme to show through */
    color: var(--primary-900);
    line-height: 1.6;
}

/* Mobile-friendly base adjustments */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; }

/* Default desktop zoom only on large screens */
@media (min-width: 1200px) {
  html { zoom: 0.9 !important; }
  @supports not (zoom: 1) {
    body { transform: scale(0.9); transform-origin: top left; width: 111.111% !important; }
  }
}

/* Responsive container paddings */
@media (max-width: 576px) {
  .container, .container-fluid, .main-content, .content-area, .card-body {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  .navbar .container, .navbar .container-fluid {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}

/* Responsive typography tweaks */
@media (max-width: 576px) {
  h1 { font-size: clamp(1.5rem, 6vw, 2rem); }
  h2 { font-size: clamp(1.25rem, 5vw, 1.75rem); }
  h3 { font-size: clamp(1.1rem, 4.5vw, 1.3rem); }
  .btn { padding: 0.5rem 0.75rem; font-size: 0.95rem; }
}

/* Responsive tables: horizontal scroll on small screens */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 576px) {
  table { font-size: 0.95rem; }
}

/* Forms: make inputs full-width on small screens */
@media (max-width: 576px) {
  .form-control, .form-select { min-height: 42px; }
  .input-group>.form-control, .input-group>.form-select { width: 100%; }
}

/* Cards: reduce margins/gaps on mobile */
@media (max-width: 576px) {
  .card { border-radius: 12px; }
  .card-body { padding: 1rem !important; }
  .row { --bs-gutter-x: 0.75rem; }
}

/* Mobile overrides: disable desktop zoom/transform hacks that break iOS scroll */
@media (max-width: 992px) {
  html { zoom: 1 !important; }
  body { transform: none !important; width: 100% !important; }
}

/* Ensure media fits container on mobile */
img, svg, canvas, video { max-width: 100%; height: auto; }

/* Navbar: collapse spacing for mobile */
@media (max-width: 576px) {
  .navbar-nav .nav-link { padding: 0.4rem 0.75rem; }
  .dropdown-menu { min-width: 12rem; font-size: 0.95rem; }
}

/* Consistent header/nav border across pages */
.navbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* Tutorial pill button */
.navbar .tutorial-btn {
  border-radius: 999px;
  padding: 4px 12px;
}

/* Critical Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 2000; /* ensure above glass cards/background */
    display: none;
    float: left;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 0.875rem;
    color: var(--primary-700);
    text-align: left;
    list-style: none;
    background-color: white;
    background-clip: padding-box;
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

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

.dropdown-menu-end {
    right: 0;
    left: auto;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.375rem 1rem;
    clear: both;
    font-weight: 600;
    color: var(--primary-700);
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--primary-900);
    background-color: var(--primary-50);
}

.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

/* Bolder, clearer navbar and menu text */
.navbar .nav-link {
    font-weight: 600;
}

/* Highlight the current page link in the navbar for all pages */
.navbar .nav-link.active,
.navbar .nav-link[aria-current="page"] {
  background: rgba(255,255,255,0.12) !important;
  border: 1px solid rgba(255,255,255,0.25) !important;
  border-radius: 10px !important;
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15) inset !important;
}

.dropdown-header {
    font-weight: 700;
}

/* Collapse Functionality */
.collapse:not(.show) {
    display: none;
}

/* Card Styles */
.card {
    background: white;
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    background: var(--primary-50);
    border-bottom: 1px solid var(--primary-200);
    padding: var(--space-6);
    font-weight: 600;
}

.card-body {
    padding: var(--space-6);
}

/* Button Styles */
.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    color: var(--primary-700);
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid var(--primary-300);
    border-radius: var(--radius-md);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
    background: white;
}

/* Tutorial button text normalization */
.tutorial-btn {
    text-transform: none !important;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.btn-primary:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-50: #0f172a;
    --primary-100: #1e293b;
    --primary-200: #334155;
    --primary-300: #475569;
    --primary-900: #f8fafc;
}

[data-theme="dark"] body {
    /* Background removed to allow ChatGPT theme to show through */
    color: var(--primary-900);
}

[data-theme="dark"] .card {
    background: var(--primary-100);
    border-color: var(--primary-200);
}

[data-theme="dark"] .dropdown-menu {
    background: var(--primary-100);
    border-color: var(--primary-300);
}

/* Elevate navbar and dropdowns above page chrome */
.navbar {
    position: sticky; /* preserve existing behavior */
    z-index: 1100 !important;
}

.navbar, .navbar * {
    overflow: visible !important; /* prevent clipping of menus */
}

.navbar .dropdown-menu {
    z-index: 2100 !important; /* above general dropdowns */
}

/* Prevent parent cards from clipping inner dropdown menus */
.card, .card * {
    overflow: visible !important;
}

/* =================================== */
/* Emphasize Logout in user dropdown   */
/* =================================== */
.dropdown-menu .dropdown-item.text-danger[onclick*="logout"] {
    font-size: 1.25rem; /* larger for visibility */
    font-weight: 800;   /* thicker text */
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    line-height: 1.3;
}

.dropdown-menu .dropdown-item.text-danger[onclick*="logout"] i {
    font-size: 1.25rem !important; /* override any inline small sizes */
}

.dropdown-menu .dropdown-item.text-danger[onclick*="logout"]:hover {
    background-color: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

/* =================================== */
/* COMPREHENSIVE MOBILE-FIRST ENHANCEMENTS */
/* =================================== */

/* Base mobile-first approach */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Enhanced mobile breakpoints */
@media (max-width: 480px) {
    /* Extra small devices */
    .container, .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .card-body {
        padding: 0.75rem !important;
    }
    
    h1 { font-size: clamp(1.25rem, 5vw, 1.75rem); }
    h2 { font-size: clamp(1.1rem, 4.5vw, 1.5rem); }
    h3 { font-size: clamp(1rem, 4vw, 1.25rem); }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        min-height: 44px; /* iOS touch target */
    }
    
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevent iOS zoom */
    }
}

@media (max-width: 576px) {
    /* Small devices - enhanced existing styles */
    .container, .container-fluid, .main-content, .content-area, .card-body {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .navbar .container, .navbar .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Enhanced typography */
    h1 { font-size: clamp(1.5rem, 6vw, 2rem); }
    h2 { font-size: clamp(1.25rem, 5vw, 1.75rem); }
    h3 { font-size: clamp(1.1rem, 4.5vw, 1.3rem); }
    
    .btn { 
        padding: 0.5rem 0.75rem; 
        font-size: 0.95rem; 
        min-height: 44px;
    }
    
    /* Enhanced table handling */
    .table-responsive { 
        width: 100%; 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    table { 
        font-size: 0.9rem; 
        min-width: 600px; /* Ensure horizontal scroll on very small screens */
    }
    
    /* Enhanced form handling */
    .form-control, .form-select { 
        min-height: 44px; 
        font-size: 16px;
    }
    
    .input-group>.form-control, .input-group>.form-select { 
        width: 100%; 
    }
    
    /* Enhanced card handling */
    .card { 
        border-radius: 12px; 
        margin-bottom: 1rem;
    }
    
    .card-body { 
        padding: 1rem !important; 
    }
    
    .row { 
        --bs-gutter-x: 0.75rem; 
        margin-left: -0.375rem;
        margin-right: -0.375rem;
    }
    
    .col, .col-*, [class*="col-"] {
        padding-left: 0.375rem;
        padding-right: 0.375rem;
    }
    
    /* Enhanced navbar */
    .navbar-nav .nav-link { 
        padding: 0.5rem 0.75rem; 
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .dropdown-menu { 
        min-width: 12rem; 
        font-size: 0.95rem; 
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    }
    
    /* Enhanced spacing */
    .mb-3, .my-3 { margin-bottom: 1rem !important; }
    .mt-3, .my-3 { margin-top: 1rem !important; }
    .p-3 { padding: 1rem !important; }
    .px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
    .py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
}

@media (max-width: 768px) {
    /* Medium devices */
    .container, .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Enhanced grid system */
    .row {
        --bs-gutter-x: 1rem;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .col, .col-*, [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Enhanced navigation */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav {
        gap: 0.25rem;
    }
    
    /* Enhanced cards */
    .card {
        margin-bottom: 1.5rem;
    }
    
    /* Enhanced forms */
    .form-row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .form-row > .col,
    .form-row > [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

@media (max-width: 992px) {
    /* Large devices - enhanced existing styles */
    html { 
        zoom: 1 !important; 
        -webkit-text-size-adjust: 100%;
    }
    
    body { 
        transform: none !important; 
        width: 100% !important; 
        overflow-x: hidden;
    }
    
    /* Enhanced container handling */
    .container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Enhanced sidebar handling */
    .sidebar, .sidebar-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        background: var(--primary-100, #ffffff);
        border-right: 1px solid var(--primary-200, #e5e7eb);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar.show, .sidebar-nav.show {
        left: 0;
    }
    
    /* Enhanced modal handling */
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Enhanced dropdown handling */
    .dropdown-menu {
        position: fixed;
        top: auto !important;
        left: 1rem !important;
        right: 1rem !important;
        width: auto !important;
        max-width: none;
        transform: none !important;
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    }
}

@media (max-width: 1200px) {
    /* Extra large devices */
    .container {
        max-width: 100%;
    }
    
    /* Enhanced table handling for medium screens */
    .table-responsive {
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
}

/* =================================== */
/* ENHANCED OVERFLOW HANDLING */
/* =================================== */

/* Prevent horizontal overflow for media/content elements only */
img, svg, canvas, video, iframe, pre, code { max-width: 100%; }

/* Enhanced table overflow handling */
.table-responsive {
    position: relative;
    background: linear-gradient(90deg, transparent 0%, transparent 95%, rgba(0,0,0,0.1) 100%);
}

.table-responsive::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.8) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.table-responsive:hover::after {
    opacity: 1;
}

/* Enhanced card overflow handling */
.card {
    overflow: hidden;
    word-wrap: break-word;
}

.card-body {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Enhanced form overflow handling */
.form-control, .form-select, .input-group {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Enhanced navigation overflow handling */
.navbar {
    overflow: visible;
}

.navbar-nav {
    overflow: visible;
}

.navbar-nav .nav-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Enhanced dropdown overflow handling */
.dropdown-menu {
    overflow: visible;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dropdown-item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Enhanced button overflow handling */
.btn {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Enhanced text overflow handling */
h1, h2, h3, h4, h5, h6, p, span, div {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Enhanced image overflow handling */
img, svg, canvas, video {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Enhanced iframe overflow handling */
iframe {
    max-width: 100%;
    border: none;
}

/* Enhanced code overflow handling */
pre, code {
    overflow-x: auto;
    white-space: pre;
    word-wrap: normal;
}

/* Enhanced list overflow handling */
ul, ol {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Enhanced link overflow handling */
a {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* =================================== */
/* TOUCH-FRIENDLY ENHANCEMENTS */
/* =================================== */

/* Ensure minimum touch target size */
.btn, .nav-link, .dropdown-item, .form-check-input, .form-check-label {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Enhanced touch scrolling */
.scrollable-content {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

/* Enhanced touch feedback */
.btn:active, .nav-link:active, .dropdown-item:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Enhanced focus states for touch */
.btn:focus, .nav-link:focus, .dropdown-item:focus,
.form-control:focus, .form-select:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* =================================== */
/* PERFORMANCE OPTIMIZATIONS */
/* =================================== */

/* Hardware acceleration for smooth animations */
.card, .btn, .dropdown-menu, .modal {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Smooth transitions */
* {
    transition: all 0.2s ease;
}

/* Optimize animations for mobile */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =================================== */
/* ACCESSIBILITY ENHANCEMENTS */
/* =================================== */

/* Enhanced focus indicators - only for interactive elements */
.btn:focus, .form-control:focus, .form-select:focus, 
input:focus, select:focus, textarea:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Remove outline for navigation elements to avoid ugly borders */
.nav-link:focus, .navbar-brand:focus, .navbar-nav .nav-link:focus {
    outline: none;
}

/* Preserve nice dropdown styling without focus outlines */
.dropdown-item:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

.dropdown-item:focus i {
    color: #e2e8f0;
}

/* Enhanced contrast for mobile */
@media (max-width: 768px) {
    .text-muted {
        color: #6c757d !important;
    }
    
    .bg-light {
        background-color: #f8f9fa !important;
    }
    
    .border {
        border-color: #dee2e6 !important;
    }
}

/* Enhanced screen reader support */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =================================== */
/* PRINT OPTIMIZATIONS */
/* =================================== */

@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .container, .container-fluid {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        break-inside: avoid;
    }
    
    .table-responsive {
        overflow: visible !important;
    }
    
    .navbar, .dropdown, .modal {
        display: none !important;
    }
}