/* ==========================================================================
   Proofclock Theme for Ummah Academy Staff Attendance Portal
   ========================================================================== */

/* ==========================================================================
   1. CSS Variables - Proofclock Theme Colors
   ========================================================================== */
:root {
    /* Primary Colors */
    --pc-primary: #e11d48;           /* Rose/Pink primary */
    --pc-primary-dark: #db2777;      /* Darker pink for gradients */
    --pc-primary-rgb: 225, 29, 72;

    /* Background Colors */
    --pc-background: #020409;        /* Deep dark navy */
    --pc-background-light: #0d1117;  /* Slightly lighter for cards */
    --pc-surface: rgba(255, 255, 255, 0.05);  /* Glass surface */

    /* Text Colors */
    --pc-text-primary: #E0E0E0;      /* Light gray text */
    --pc-text-secondary: #9ca3af;    /* Muted text */
    --pc-text-muted: #6b7280;        /* Very muted text */

    /* Border Colors */
    --pc-border: rgba(255, 255, 255, 0.1);
    --pc-border-light: rgba(255, 255, 255, 0.08);

    /* Status Colors */
    --pc-success: #10b981;           /* Emerald green */
    --pc-success-rgb: 16, 185, 129;
    --pc-warning: #f59e0b;           /* Amber */
    --pc-warning-rgb: 245, 158, 11;
    --pc-danger: #ef4444;            /* Red */
    --pc-danger-rgb: 239, 68, 68;
    --pc-info: #3b82f6;              /* Blue */
    --pc-info-rgb: 59, 130, 246;

    /* Glassmorphism Values */
    --glass-blur: blur(10px);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-bg-dark: rgba(13, 17, 23, 0.95);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Animation Timing */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(225, 29, 72, 0.3);
    --shadow-glow-strong: 0 0 30px rgba(225, 29, 72, 0.4);

    /* Touch Target Sizing */
    --touch-target-min: 44px;

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

/* ==========================================================================
   2. Base Styling
   ========================================================================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--pc-background);
    color: var(--pc-text-primary);
    line-height: 1.6;
}

/* Override Bootstrap dark theme background */
[data-bs-theme="dark"] {
    --bs-body-bg: var(--pc-background);
    --bs-body-color: var(--pc-text-primary);
}

/* ==========================================================================
   3. Glassmorphism Utility Classes
   ========================================================================== */
.glass {
    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);
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.glass-dark {
    background: var(--glass-bg-dark);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

/* ==========================================================================
   4. Button Styling
   ========================================================================== */
.btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-medium);
    min-height: var(--touch-target-min);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Primary Button - Proofclock Gradient */
.btn-primary {
    background: linear-gradient(to right, var(--pc-primary), var(--pc-primary-dark));
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(to right, var(--pc-primary), var(--pc-primary-dark));
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 25px rgba(225, 29, 72, 0.4);
}

.btn-primary:focus,
.btn-primary:focus-visible {
    background: linear-gradient(to right, var(--pc-primary), var(--pc-primary-dark));
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.3), 0 4px 15px rgba(225, 29, 72, 0.3);
}

/* Outline Primary Button */
.btn-outline-primary {
    border: 2px solid var(--pc-primary);
    color: var(--pc-primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: linear-gradient(to right, var(--pc-primary), var(--pc-primary-dark));
    border-color: transparent;
    color: white;
}

/* Secondary/Ghost Button */
.btn-secondary,
.btn-outline-secondary {
    border: 1px solid var(--glass-border);
    color: var(--pc-text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
    background: rgba(225, 29, 72, 0.15);
    color: var(--pc-primary);
    border-color: rgba(225, 29, 72, 0.3);
}

/* Success Button */
.btn-success {
    background: linear-gradient(to right, var(--pc-success), #059669);
    border: none;
    color: white;
}

.btn-success:hover {
    background: linear-gradient(to right, var(--pc-success), #059669);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(to right, var(--pc-danger), #dc2626);
    border: none;
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(to right, var(--pc-danger), #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* Warning Button */
.btn-warning {
    background: linear-gradient(to right, var(--pc-warning), #d97706);
    border: none;
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(to right, var(--pc-warning), #d97706);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

/* Button Sizes */
.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
    min-height: 52px;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: var(--touch-target-min);
}

/* ==========================================================================
   5. Form Styling
   ========================================================================== */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--pc-text-primary);
    padding: 0.75rem 1rem;
    min-height: var(--touch-target-min);
    transition: all var(--transition-medium);
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--pc-primary);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.2);
    color: var(--pc-text-primary);
    outline: none;
}

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

.form-label {
    color: var(--pc-text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Form Check (Checkboxes/Radios) */
.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}

.form-check-input:checked {
    background-color: var(--pc-primary);
    border-color: var(--pc-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.2);
    border-color: var(--pc-primary);
}

/* ==========================================================================
   6. Card Styling - Glassmorphism
   ========================================================================== */
.card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-medium);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Disable hover transform for cards containing forms or buttons */
.card:has(form):hover,
.card:has(button):hover,
.card.no-hover:hover {
    transform: none;
}

/* Disable transform on buttons inside cards to prevent click issues */
.card .btn:hover {
    transform: none;
}

/* Allow dropdowns to overflow card boundaries */
.card:has(.dropdown),
.card:has(.form-select) {
    overflow: visible;
    position: relative;
    z-index: 100;
}

.card:has(.dropdown) .card-body,
.card:has(.form-select) .card-body {
    overflow: visible;
}

.card-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 1.25rem;
    color: var(--pc-text-primary);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
    color: var(--pc-text-primary);
}

.card-title {
    color: var(--pc-text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--pc-text-secondary);
}

.card-footer {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--glass-border);
    padding: 1rem 1.25rem;
}

/* Stats Cards - Neutral glass with subtle accent */
.stats-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.stats-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.stats-card .display-6,
.stats-card .stat-value {
    color: var(--pc-text-primary);
    font-weight: 700;
}

/* ==========================================================================
   7. Alert Styling
   ========================================================================== */
.alert {
    border: none;
    border-radius: var(--radius-md);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-left: 4px solid;
    padding: 1rem 1.25rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-left-color: var(--pc-success);
    color: #a7f3d0;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-left-color: var(--pc-danger);
    color: #fecaca;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-left-color: var(--pc-warning);
    color: #fde68a;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border-left-color: var(--pc-info);
    color: #bfdbfe;
}

.alert .btn-close {
    filter: invert(1);
    opacity: 0.5;
}

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

/* ==========================================================================
   8. Badge Styling
   ========================================================================== */
.badge {
    font-size: 0.8em;
    padding: 0.5em 0.9em;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.badge.bg-success,
.bg-success {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.bg-warning,
.bg-warning {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.bg-danger,
.bg-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.bg-primary,
.bg-primary {
    background: rgba(225, 29, 72, 0.2) !important;
    color: var(--pc-primary) !important;
    border: 1px solid rgba(225, 29, 72, 0.3);
}

.badge.bg-info,
.bg-info {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge.bg-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--pc-text-secondary) !important;
    border: 1px solid var(--glass-border);
}

/* ==========================================================================
   9. Table Styling
   ========================================================================== */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--pc-text-primary);
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.table thead th {
    background: rgba(255, 255, 255, 0.03);
    border: none;
    color: var(--pc-text-secondary);
    font-weight: 600;
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody tr {
    background: rgba(255, 255, 255, 0.02);
    transition: all var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(225, 29, 72, 0.08);
}

.table tbody td {
    border: none;
    padding: 1rem;
    vertical-align: middle;
    color: var(--pc-text-primary);
}

.table tbody td:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.table tbody td:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Disable transform on buttons inside tables to prevent click issues */
.table .btn:hover {
    transform: none;
}

/* Striped variant */
.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.03);
}

/* Table responsive wrapper */
.table-responsive {
    border-radius: var(--radius-md);
}

/* ==========================================================================
   10. Navbar Styling
   ========================================================================== */
.navbar {
    background: rgba(2, 4, 9, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1100;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--pc-text-primary) !important;
}

.navbar-brand img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.nav-link {
    color: var(--pc-text-secondary) !important;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--pc-primary) !important;
}

.nav-link.active {
    color: var(--pc-primary) !important;
}

/* User dropdown styling */
.navbar .dropdown-toggle {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-medium);
}

.navbar .dropdown-toggle:hover {
    background: rgba(225, 29, 72, 0.1);
}

.navbar .dropdown-toggle[aria-expanded="true"] {
    background: rgba(225, 29, 72, 0.15);
}

.navbar .dropdown-toggle .fa-chevron-down {
    transition: transform var(--transition-medium);
}

.navbar .dropdown-toggle[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* Dropdown header for mobile */
.dropdown-header {
    color: var(--pc-text-primary);
    font-weight: 600;
}

/* ==========================================================================
   11. Dropdown Styling
   ========================================================================== */
.dropdown-menu {
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    z-index: 1100;
}

.dropdown {
    overflow: visible !important;
}

.dropdown-item {
    color: var(--pc-text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(225, 29, 72, 0.15);
    color: var(--pc-primary);
}

.dropdown-item:active {
    background: rgba(225, 29, 72, 0.25);
}

.dropdown-item.active,
.dropdown-item:focus {
    background: rgba(225, 29, 72, 0.2) !important;
    color: var(--pc-text-primary) !important;
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu .dropdown-item {
    display: block;
    width: 100%;
    color: var(--pc-text-secondary) !important;
}

.dropdown-divider {
    border-color: var(--glass-border);
    margin: 0.5rem 0;
}

/* Dropdown menu positioning */
.dropdown-menu-end {
    right: 0;
    left: auto;
}

/* Mobile dropdown adjustments */
@media (max-width: 576px) {
    .navbar .dropdown-menu {
        width: 100%;
        border-radius: var(--radius-md);
        margin-top: 0.5rem;
    }
}

/* ==========================================================================
   12. Modal Styling
   ========================================================================== */
.modal-content {
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
    color: var(--pc-text-primary);
}

.modal-footer {
    border-top: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
}

.modal-title {
    color: var(--pc-text-primary);
    font-weight: 600;
}

.btn-close {
    filter: invert(1);
    opacity: 0.5;
}

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

/* Success Modal specific */
#successModal .modal-content {
    text-align: center;
}

#successModal .text-success {
    color: var(--pc-success) !important;
}

#successModal .text-warning {
    color: var(--pc-warning) !important;
}

/* ==========================================================================
   13. Footer Styling
   ========================================================================== */
footer {
    background: var(--pc-background) !important;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}

footer small {
    color: var(--pc-text-muted);
}

/* ==========================================================================
   14. Animation Keyframes
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(225, 29, 72, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(225, 29, 72, 0.5);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

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

/* Animation utility classes */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
}

/* Staggered animation delays */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* Initially hidden for animation */
.animate-on-scroll {
    opacity: 0;
}

/* Glow effect for primary elements */
.glow-primary {
    animation: pulse-glow 2s infinite;
}

/* Loading shimmer effect */
.shimmer {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Loading animation */
.loading {
    animation: pulse 1.5s infinite;
}

.spinner {
    animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   15. QR Code & Scanner Styling
   ========================================================================== */
.qr-display {
    transition: all var(--transition-medium);
    border-radius: var(--radius-xl);
}

.qr-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

#qr-reader {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

#qr-reader video {
    border-radius: var(--radius-md);
}

/* Scanner container - responsive max-width */
.scanner-container {
    width: 100%;
    max-width: min(400px, 90vw);
    margin: 0 auto;
}

/* ==========================================================================
   16. Utility Classes
   ========================================================================== */
.text-gradient {
    background: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-primary {
    color: var(--pc-primary) !important;
}

.text-muted {
    color: var(--pc-text-muted) !important;
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, var(--pc-primary) 0%, var(--pc-primary-dark) 100%) 1;
}

/* Admin panel specific styling */
.admin-sidebar {
    background: linear-gradient(135deg, var(--pc-background) 0%, var(--pc-background-light) 100%);
}

/* List group styling */
.list-group-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--pc-text-primary);
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   17. Mobile Responsive Styles
   ========================================================================== */

/* Medium screens and below (tablets) */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }

    .display-1 {
        font-size: 3rem;
    }

    .display-6 {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Reduce icon sizes */
    .fa-2x {
        font-size: 1.5em;
    }

    .fa-3x {
        font-size: 2em;
    }
}

/* Small screens (mobile phones) */
@media (max-width: 576px) {
    body {
        font-size: 0.9375rem;
    }

    /* Ensure touch-friendly button sizes */
    .btn {
        min-height: var(--touch-target-min);
        padding: 0.625rem 1rem;
    }

    .btn-sm {
        min-height: var(--touch-target-min);
        padding: 0.5rem 0.875rem;
    }

    /* Form controls touch-friendly */
    .form-control,
    .form-select {
        min-height: var(--touch-target-min);
        padding: 0.625rem 0.875rem;
    }

    /* Card adjustments */
    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.875rem 1rem;
    }

    /* Table adjustments */
    .table tbody td {
        padding: 0.75rem;
    }

    .table thead th {
        padding: 0.75rem;
        font-size: 0.7rem;
    }

    /* Modal adjustments */
    .modal-body {
        padding: 1rem;
    }

    .modal-header,
    .modal-footer {
        padding: 1rem;
    }

    /* Navbar brand on mobile */
    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-brand img {
        height: 32px;
    }

    /* Display sizes */
    .display-4 {
        font-size: 1.75rem;
    }

    .display-6 {
        font-size: 1.25rem;
    }

    /* Reduce animation intensity on mobile */
    .card:hover,
    .btn:hover {
        transform: translateY(-2px);
    }

    /* Passkey list item flex */
    .list-group-item.d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-body {
        padding: 0.875rem;
    }

    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    /* QR display responsive */
    .qr-display {
        padding: 1rem !important;
    }

    /* Success card responsive */
    .success-card {
        padding: 1rem;
        max-width: 100%;
    }
}

/* Mobile card view for tables */
@media (max-width: 767.98px) {
    .table-card-mobile {
        display: block;
    }

    .table-card-mobile thead {
        display: none;
    }

    .table-card-mobile tbody {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .table-card-mobile tbody tr {
        display: flex;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-md);
        padding: 1rem;
    }

    .table-card-mobile tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--glass-border);
    }

    .table-card-mobile tbody td:last-child {
        border-bottom: none;
    }

    .table-card-mobile tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--pc-text-secondary);
        text-transform: uppercase;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   18. Print Styles
   ========================================================================== */
@media print {
    :root {
        --pc-text-primary: #000000;
        --pc-background: #ffffff;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .navbar,
    footer,
    .no-print,
    .btn {
        display: none !important;
    }

    .card {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        page-break-inside: avoid;
    }

    .table {
        border-collapse: collapse !important;
    }

    .table td,
    .table th {
        border: 1px solid #ddd !important;
        background: white !important;
    }

    .badge {
        border: 1px solid currentColor !important;
        background: transparent !important;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* ==========================================================================
   19. Accessibility
   ========================================================================== */

/* Enhanced Focus States */
*:focus-visible {
    outline: 2px solid var(--pc-primary);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.3);
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--pc-primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    z-index: 9999;
    transition: top var(--transition-medium);
}

.skip-link:focus {
    top: 0;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --pc-primary: #ff4d6d;
        --pc-text-primary: #ffffff;
        --glass-border: rgba(255, 255, 255, 0.5);
    }

    .card,
    .btn,
    .form-control {
        border-width: 2px;
    }

    .badge {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .card:hover,
    .btn:hover {
        transform: none !important;
    }

    .animate-on-scroll {
        opacity: 1;
    }
}

/* ==========================================================================
   20. Kiosk Specific Styling
   ========================================================================== */
.kiosk-container {
    animation: fadeIn 1s ease-in;
}

/* ==========================================================================
   21. Dark Mode Specific Adjustments (ensure compatibility)
   ========================================================================== */
[data-bs-theme="dark"] .card {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(225, 29, 72, 0.08);
}
