/**
 * Torsido Technologies - Responsive Utilities
 * Additional responsive helpers and mobile optimizations
 */

/* Touch-Friendly Tap Targets (minimum 44x44px for accessibility) */
button,
.button,
.btn,
a.button,
a.btn,
.sidebar-link,
.action-button,
.tab-button {
    min-height: 44px;
    min-width: 44px;
}

/* Prevent Text Selection on Buttons (UX improvement) */
button,
.button,
.btn,
.sidebar-toggle,
.action-button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Smooth Scrolling for Better UX */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Prevent Horizontal Overflow */
body {
    overflow-x: hidden;
}

/* Better Touch Scrolling for iOS */
.table-wrapper,
.admin-content,
.modal-content {
    -webkit-overflow-scrolling: touch;
}

/* Hide Elements on Mobile */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide Elements on Desktop */
@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Responsive Text Sizing */
@media (max-width: 480px) {
    h1, .page-title {
        font-size: 1.5rem !important;
    }
    
    h2, .section-title {
        font-size: 1.25rem !important;
    }
    
    h3, .card-title {
        font-size: 1.125rem !important;
    }
    
    /* Smaller buttons on mobile */
    .btn, .button {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* Responsive Grid Utilities */
@media (max-width: 768px) {
    .settings-grid,
    .settings-grid-2col,
    .settings-row,
    .modal-grid {
        grid-template-columns: 1fr !important;
    }
    
    .charts-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Stack form rows on mobile */
    .form-row {
        grid-template-columns: 1fr !important;
    }
}

/* Better Modal Positioning on Small Screens */
@media (max-width: 767px) {
    .modal-content,
    .admin-modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 85vh !important;
        margin: 2.5vh auto !important;
    }
    
    .modal-header,
    .admin-modal-header {
        padding: 1rem !important;
    }
    
    .modal-body,
    .admin-modal-body {
        padding: 1rem !important;
    }
}

/* Improved Table Scrolling on Mobile */
@media (max-width: 767px) {
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    
    .minimal-table,
    .data-table {
        min-width: 600px;
    }
    
    /* Add scroll indicator shadow */
    .table-wrapper {
        background: 
            linear-gradient(to right, white 30%, rgba(255,255,255,0)),
            linear-gradient(to right, rgba(255,255,255,0), white 70%) 0 100%,
            radial-gradient(farthest-side at 0% 50%, rgba(0,0,0,.2), rgba(0,0,0,0)),
            radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%;
        background-repeat: no-repeat;
        background-color: white;
        background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
        background-position: 0 0, 100%, 0 0, 100%;
        background-attachment: local, local, scroll, scroll;
    }
}

/* Optional stacked table layout for ultra-small screens */
@media (max-width: 640px) {
    .table-stack {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .table-stack thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
    }

    .table-stack tbody,
    .table-stack tr,
    .table-stack td {
        display: block;
        width: 100%;
    }

    .table-stack tr {
        background: #ffffff;
        border-radius: 12px;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
        margin-bottom: 1rem;
        overflow: hidden;
    }

    .table-stack td {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
        display: grid;
        grid-template-columns: minmax(0, 160px) minmax(0, 1fr);
        gap: 0.75rem;
        align-items: start;
    }

    .table-stack td:last-child {
        border-bottom: none;
    }

    .table-stack td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #0f172a;
        opacity: 0.7;
        font-size: 0.75rem;
    }
}

/* Sticky table header helper */
@supports ((position: -webkit-sticky) or (position: sticky)) {
    .table-sticky-header thead th {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 2;
        background: inherit;
    }
}

@supports not ((backdrop-filter: blur(0)) or (-webkit-backdrop-filter: blur(0))) {
    .navigation-menu,
    .navigation-menu__item .button--secondary,
    .language-dropdown,
    .mobile-menu-toggle {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    .navigation-menu {
        background: linear-gradient(180deg, #0f172a 0%, #111827 90%) !important;
    }

    .language-dropdown {
        background: rgba(15, 23, 42, 0.92) !important;
    }

    .mobile-menu-toggle {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95)) !important;
    }
}

/* Better Focus States for Accessibility */
button:focus,
.button:focus,
.btn:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #8B5CF6;
    outline-offset: 2px;
}

/* Disable Outline for Mouse Users (Keep for Keyboard) */
button:focus:not(:focus-visible),
.button:focus:not(:focus-visible),
.btn:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

/* Safe Area Insets for iPhone X and newer */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    .admin-header {
        padding-left: max(2rem, calc(2rem + env(safe-area-inset-left)));
        padding-right: max(2rem, calc(2rem + env(safe-area-inset-right)));
    }
    
    .admin-sidebar {
        padding-left: max(0px, env(safe-area-inset-left));
    }
}

/* Landscape Orientation Fixes for Mobile */
@media (max-width: 1024px) and (orientation: landscape) {
    .admin-header {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    .hero-section {
        min-height: 80vh;
        padding: 4rem 0;
    }
}

/* Print Styles */
@media print {
    .admin-sidebar,
    .admin-header,
    .header-right,
    .sidebar-toggle,
    .action-buttons,
    .btn,
    .button {
        display: none !important;
    }
    
    .admin-main {
        margin-left: 0 !important;
    }
    
    .admin-content {
        padding: 0 !important;
    }
    
    .table-wrapper {
        overflow: visible !important;
    }
    
    .minimal-table,
    .data-table {
        min-width: 100% !important;
    }
}

/* Reduced Motion for Accessibility */
@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;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .button,
    .btn {
        border: 2px solid currentColor !important;
    }
    
    .sidebar-link.active {
        outline: 2px solid currentColor;
    }
}

/* Dark Mode Support (Optional - for future implementation) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here in the future */
}

/* Orientation Change Handler */
@media (orientation: portrait) {
    .landscape-only {
        display: none !important;
    }
}

@media (orientation: landscape) {
    .portrait-only {
        display: none !important;
    }
}

/* ========================================
   MOBILE DESIGN ENHANCEMENTS
   ======================================== */

/* Compact Spacing for Mobile */
@media (max-width: 767px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-section {
        padding: calc(80px + 2rem) 0 2.5rem 0;
        min-height: 70vh;
    }
    
    .hero-title {
        font-size: 1.75rem !important;
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: 0.95rem !important;
        margin-bottom: 1.5rem;
    }
    
    .features-showcase,
    .core-features,
    .how-it-works {
        padding: 2.5rem 0;
    }
    
    .stats-showcase {
        padding: 2rem 0;
    }
    
    .final-cta {
        padding: 2rem 0;
    }
    
    .site-footer {
        padding: 2rem 0 1.5rem;
    }
    
    /* Showcase Section Mobile */
    .showcase-header {
        margin-bottom: 2rem;
    }
    
    .showcase-title {
        font-size: 1.5rem !important;
    }
    
    .showcase-subtitle {
        font-size: 0.9rem;
    }
    
    .showcase-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .showcase-left,
    .showcase-right {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .showcase-card {
        min-height: 180px;
        padding: 1.5rem;
    }
    
    .showcase-card--large {
        min-height: 180px;
    }
    
    .showcase-card-title {
        font-size: 1.125rem;
    }
    
    .showcase-card-image {
        width: 70px;
        height: 70px;
        bottom: 1rem;
        right: 1rem;
    }
    
    /* Content Highlight Mobile */
    .content-highlight {
        padding: 2.5rem 0;
    }
    
    .highlight-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .highlight-title {
        font-size: 1.5rem !important;
    }
    
    .highlight-description {
        font-size: 0.9rem;
    }
    
    .highlight-image-container {
        max-width: 100%;
        aspect-ratio: 16 / 11;
    }
}

/* ========================================
   PROFESSIONAL MOBILE NAVIGATION
   ======================================== */

@media (max-width: 767px) {
    /* Modern Full-Screen Mobile Menu */
    .navigation-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 55%),
                    linear-gradient(160deg, #0f172a 0%, #1f2937 55%, #0f172a 100%);
        flex-direction: column;
        gap: 0;
        width: 100%;
        height: 100vh;
        padding: 5rem 2rem 2rem;
        z-index: 1000;
        overflow-y: auto;
        animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
    }
    
    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateX(100%);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    .navigation-menu.mobile-open {
        display: flex;
    }
    
    .navigation-menu__item {
        width: 100%;
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
        margin: 0;
    }
    
    .navigation-menu__item:last-child {
        border-bottom: none;
    }
    
    .navigation-menu__link,
    .navigation-menu__item .button,
    .navigation-menu__item .language-btn {
        width: 100%;
        text-align: left;
        font-size: 1.125rem;
        padding: 1.25rem 1.5rem;
        border-radius: 0;
        color: rgba(226, 232, 240, 0.95) !important;
        background: transparent !important;
        border: none !important;
        font-weight: 500;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .navigation-menu__link:hover,
    .navigation-menu__item .button:hover,
    .navigation-menu__item .language-btn:hover {
        background: rgba(148, 163, 184, 0.14) !important;
        color: #f8fafc !important;
        padding-left: 2rem;
    }
    
    /* Special styling for Login/Register buttons in menu */
    .navigation-menu__item .button--primary,
    .navigation-menu__item .button--secondary {
        margin-top: 1rem;
        padding: 1rem 1.5rem;
        border-radius: 12px;
        font-weight: 600;
        text-align: center;
        justify-content: center;
    }
    
    .navigation-menu__item .button--primary {
        background: linear-gradient(135deg, #10b981, #059669) !important;
        color: #f8fafc !important;
        border: 1px solid rgba(16, 185, 129, 0.35) !important;
        box-shadow: 0 12px 28px rgba(16, 185, 129, 0.28);
    }
    
    .navigation-menu__item .button--primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 32px rgba(16, 185, 129, 0.34);
        padding-left: 1.5rem;
    }
    
    .navigation-menu__item .button--secondary {
        background: transparent !important;
        color: #e2e8f0 !important;
        border: 1px solid rgba(148, 163, 184, 0.6) !important;
        backdrop-filter: blur(10px);
    }
    
    .navigation-menu__item .button--secondary:hover {
        background: rgba(148, 163, 184, 0.18) !important;
        border-color: rgba(148, 163, 184, 0.7) !important;
        padding-left: 1.5rem;
    }
    
    /* Language Selector in Mobile Menu */
    .language-selector {
        width: 100%;
    }
    
    .language-btn {
        justify-content: flex-start;
        color: rgba(255, 255, 255, 0.95);
    }
    
    .language-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        margin-top: 0;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        backdrop-filter: blur(10px);
        margin-left: 1.5rem;
        margin-right: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .language-option {
        color: rgba(255, 255, 255, 0.9);
        padding: 0.875rem 1rem;
    }
    
    .language-option:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }
}

/* Professional Mobile Menu Toggle Button */
@media (max-width: 767px) {
    .mobile-menu-toggle {
        position: relative;
        width: 44px;
        height: 44px;
        background: linear-gradient(135deg, #10b981, #059669);
        backdrop-filter: blur(10px);
        border-radius: 10px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        box-shadow: 0 10px 24px rgba(16, 185, 129, 0.25);
    }
    
    .mobile-menu-toggle:hover {
        background: linear-gradient(135deg, #14d8a5, #06b280);
        transform: scale(1.05);
        box-shadow: 0 12px 28px rgba(16, 185, 129, 0.3);
    }
    
    .mobile-menu-toggle svg {
        transition: transform 0.3s ease;
    }
    
    /* Rotate icon when menu is open */
    .navigation-menu.mobile-open ~ .site-navigation .mobile-menu-toggle svg {
        transform: rotate(90deg);
    }
    
    .site-header.scrolled .mobile-menu-toggle {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.9));
        border: 1px solid rgba(16, 185, 129, 0.35);
        box-shadow: 0 8px 20px rgba(16, 185, 129, 0.22);
    }
    
    .site-header.scrolled .mobile-menu-toggle:hover {
        background: linear-gradient(135deg, #14d8a5, #06b280);
        box-shadow: 0 10px 24px rgba(16, 185, 129, 0.28);
    }
}

/* ========================================
   VIBRANT DESIGN ELEMENTS
   ======================================== */

@media (max-width: 767px) {
    /* Gradient Section Titles */
    .section-title {
        font-size: 1.5rem !important;
        line-height: 1.2;
        margin-bottom: 0.75rem;
        background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        font-weight: 700;
    }
    
    /* Gradient Badges */
    .section-badge {
        background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
        color: #ffffff;
        padding: 0.375rem 1rem;
        border-radius: 16px;
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        display: inline-block;
        margin-bottom: 0.75rem;
        box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
    }
    
    /* Feature Cards with Rainbow Border */
    .feature-card {
        padding: 1.25rem;
        border-radius: 16px;
        margin-bottom: 1rem;
        position: relative;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    }
    
    .feature-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #8B5CF6 0%, #A855F7 50%, #EC4899 100%);
    }
    
    .feature-card__icon {
        width: 48px;
        height: 48px;
        background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
        border-radius: 12px;
        margin: 0 auto 0.875rem;
        box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
    }
    
    .feature-card__title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .feature-card__description {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    /* Workflow Cards */
    .workflow-card {
        padding: 1.25rem;
        border-radius: 12px;
        margin-bottom: 0.875rem;
    }
    
    .workflow-card__number {
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
        border-radius: 10px;
        margin-bottom: 0.75rem;
        box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
    }
    
    /* Stats Cards - Glass Effect */
    .stat-item {
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 16px;
        padding: 1.5rem 1.25rem;
        margin-bottom: 0.875rem;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    }
    
    .stat-item__value {
        font-size: 2.5rem !important;
        margin-bottom: 0.375rem;
    }
    
    .stat-item__label {
        font-size: 0.8rem;
    }
    
    /* CTA Buttons */
    .cta-title {
        font-size: 1.5rem !important;
        margin-bottom: 0.875rem;
        background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        font-weight: 700;
    }
    
    .cta-button--primary,
    .cta-button--secondary {
        padding: 0.875rem 1.5rem;
        border-radius: 8px;
        font-weight: 600;
        width: 100%;
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
    }
    
    .cta-button--primary {
        background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
    }
    
    /* Footer Compact */
    .footer-column {
        margin-bottom: 1.5rem;
    }
    
    .footer-logo {
        margin-bottom: 0.75rem;
    }
    
    .footer-logo-text {
        background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .footer-social {
        margin-top: 1rem;
    }
    
    .social-link {
        width: 44px;
        height: 44px;
        background: rgba(139, 92, 246, 0.2);
        border-radius: 12px;
    }
    
    .social-link:hover {
        background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    }
}

/* ========================================
   TABLET OPTIMIZATIONS (768px - 1024px)
   ======================================== */

@media (min-width: 768px) and (max-width: 1024px) {
    .admin-sidebar {
        width: 240px;
    }
    
    .admin-main {
        margin-left: 240px;
    }
    
    .stats-grid-compact {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .minimal-table {
        min-width: 700px;
    }
    
    .content-card {
        padding: 1.5rem;
    }
    
    .page-header-with-action {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .page-header-actions {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .btn-add {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* ========================================
   MOBILE APP-LIKE ENHANCEMENTS
   ======================================== */

@media (max-width: 767px) {
    /* App-like body styling */
    body.admin-body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }
    
    /* Smooth transitions for app-like feel */
    .admin-sidebar,
    .admin-main,
    .content-card,
    .stat-card-minimal {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Enhanced touch targets */
    .sidebar-link,
    .action-btn,
    .table-action-btn,
    .btn-add,
    button,
    a.button {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: rgba(139, 92, 246, 0.2);
    }
    
    /* Card elevation for depth */
    .content-card,
    .stat-card-minimal,
    .chart-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
                    0 1px 2px rgba(0, 0, 0, 0.04);
        border: 1px solid rgba(0, 0, 0, 0.04);
    }
    
    /* Improved spacing for mobile */
    .admin-content {
        padding-bottom: 2rem;
    }
    
    /* Better form inputs on mobile */
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem;
        border-radius: 10px;
        border: 1.5px solid #e5e7eb;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    
    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        border-color: #8B5CF6;
        box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
        outline: none;
    }
    
    /* Better button styling */
    .btn-add,
    .btn-primary,
    .btn-secondary {
        border-radius: 10px;
        font-weight: 600;
        letter-spacing: 0.02em;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transition: all 0.2s ease;
    }
    
    .btn-add:active,
    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }
    
    /* Improved table scrolling indicator */
    .table-wrapper {
        position: relative;
    }
    
    .table-wrapper::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.05));
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .table-wrapper.scrolling::after {
        opacity: 1;
    }
    
    /* Better modal on mobile */
    .admin-modal-content {
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Improved badge styling */
    .badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
        border-radius: 8px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
    }
    
    /* Better empty states */
    .empty-state {
        padding: 3rem 1.5rem;
        text-align: center;
    }
    
    .empty-state-icon {
        width: 64px;
        height: 64px;
        margin: 0 auto 1rem;
        opacity: 0.5;
    }
    
    .empty-state-title {
        font-size: 1.125rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: #374151;
    }
    
    .empty-state-text {
        font-size: 0.875rem;
        color: #6b7280;
        margin-bottom: 1.5rem;
    }
    
    /* Improved page headers */
    .page-header-title h2 {
        font-size: 1.375rem;
        font-weight: 700;
        margin-bottom: 0.25rem;
    }
    
    .page-header-title p {
        font-size: 0.875rem;
        color: #6b7280;
    }
    
    /* Better action buttons in tables */
    .table-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        min-width: 100px;
    }
    
    .table-action-btn {
        width: 100%;
        padding: 0.625rem;
        font-size: 0.8125rem;
        border-radius: 8px;
        text-align: center;
    }
    
    /* Improved stats cards */
    .stat-card-minimal {
        text-align: center;
        padding: 1.25rem;
    }
    
    .stat-minimal-value {
        font-size: 2rem;
        font-weight: 700;
        line-height: 1.2;
        margin-bottom: 0.5rem;
        background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .stat-minimal-label {
        font-size: 0.875rem;
        color: #6b7280;
        font-weight: 500;
    }
}

