/*
 * Gambolthemes - Digital Marketplace
 * Responsive Stylesheet (Mobile & Tablet)
 * ======================================
 */

/* ===== CSS Variables for Responsive ===== */
:root {
    --header-height: 76px;
    --header-height-scrolled: 64px;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 0;
}

/* ===== Header Auth Buttons - Desktop ===== */
.header-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-auth-btn .btn-icon {
    width: 16px;
    height: 16px;
    display: none;
}

.header-auth-btn .btn-text {
    display: inline;
}

/* ===== Mobile Search Button - Hidden on Desktop ===== */
.mobile-search-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-color: var(--primary);
}

.mobile-search-btn svg {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
}

/* ===== Mobile Search Overlay ===== */
.mobile-search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-search-overlay.active {
    display: flex;
    opacity: 1;
}

.mobile-search-container {
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
}

.mobile-search-form {
    display: flex;
    align-items: center;
    background: var(--dark-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 12px 16px;
    gap: 12px;
}

.mobile-search-icon {
    width: 22px;
    height: 22px;
    color: var(--gray);
    flex-shrink: 0;
}

.mobile-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--white);
    font-size: 16px;
    font-family: inherit;
}

.mobile-search-input::placeholder {
    color: var(--gray);
}

.mobile-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.mobile-search-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-search-close svg {
    width: 18px;
    height: 18px;
}

/* ===== Large Tablets & Small Desktops (max-width: 1200px) ===== */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 24px;
    }
    
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr 1fr;
    }
    
    .search-input {
        width: 200px;
    }
    
    .search-input:focus {
        width: 240px;
    }
    
    /* Admin Grid adjustments */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Tablets (max-width: 1024px) ===== */
@media (max-width: 1024px) {
    /* Hide desktop navigation */
    .nav {
        display: none;
    }
    
    /* Show mobile menu button */
    .mobile-menu-btn {
        display: flex;
    }
    
    /* Footer adjustments */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
    
    /* Typography scaling */
    h1 { font-size: 40px; }
    h2 { font-size: 32px; }
    h3 { font-size: 24px; }
    
    /* Header actions */
    .header-actions {
        gap: 12px;
    }
    
    /* Dashboard Layout */
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    
    .dashboard-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 1001;
        border-radius: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }
    
    .dashboard-sidebar.show {
        transform: translateX(0);
    }
    
    .dashboard-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .dashboard-sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    .dashboard-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: var(--dark-light);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        color: var(--white);
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        margin-bottom: 24px;
    }
    
    .dashboard-sidebar-toggle:hover {
        border-color: var(--primary);
    }
    
    /* Admin Sidebar */
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .admin-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 99;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .admin-sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    .admin-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: var(--dark-light);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        color: var(--white);
        cursor: pointer;
        margin-right: 16px;
        flex-shrink: 0;
    }
    
    .admin-sidebar-toggle:hover {
        border-color: var(--primary);
    }
    
    /* Product Grid */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Mobile Landscape & Small Tablets (max-width: 768px) ===== */
@media (max-width: 768px) {
    /* Container */
    .container {
        padding: 0 16px;
    }
    
    /* Hide search box, show search button on mobile */
    .search-box {
        display: none;
    }
    
    .mobile-search-btn {
        display: flex;
    }
    
    /* Header */
    .header {
        padding: 12px 0;
    }
    
    /* Hide logo text on tablet/mobile - only show icon */
    .logo span {
        display: none;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
    }
    
    /* Typography */
    h1 { font-size: 32px; }
    h2 { font-size: 26px; }
    h3 { font-size: 22px; }
    h4 { font-size: 18px; }
    
    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .btn-lg {
        padding: 14px 28px;
        font-size: 15px;
    }
    
    .btn-sm {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    /* Header auth buttons - icon only on tablet/mobile */
    .header-auth-btn {
        padding: 10px !important;
        min-width: 40px;
        height: 40px;
        justify-content: center;
    }
    
    .header-auth-btn .btn-text {
        display: none;
    }
    
    .header-auth-btn .btn-icon {
        display: block;
        width: 18px;
        height: 18px;
    }
    
    /* Cart button */
    .header-cart-btn {
        width: 40px;
        height: 40px;
    }
    
    /* User avatar */
    .user-avatar {
        width: 40px;
        height: 40px;
    }
    
    /* Footer */
    .footer {
        padding: 60px 0 24px;
        margin-top: 60px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    /* Main content */
    .main-content {
        padding-top: 80px;
    }
    
    /* Cards */
    .card {
        border-radius: 16px;
    }
    
    /* Forms */
    .form-control {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Tables - make scrollable */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }
    
    .table th,
    .table td {
        padding: 12px 16px;
        white-space: nowrap;
    }
    
    /* Alerts */
    .alert {
        padding: 14px 16px;
        font-size: 13px;
    }
    
    /* Pagination */
    .pagination a,
    .pagination span {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }
    
    /* Modal */
    .modal {
        border-radius: 16px;
        margin: 16px;
        max-height: calc(100vh - 32px);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    /* Empty state */
    .empty-state {
        padding: 40px 20px;
    }
    
    .empty-state i {
        width: 48px;
        height: 48px;
    }
    
    .empty-state h3 {
        font-size: 18px;
    }
    
    /* Hero Section */
    .hero {
        padding: 80px 0 60px;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 24px;
    }
    
    .hero-stat {
        flex: 1 1 40%;
    }
    
    .hero-stat-value {
        font-size: 28px;
    }
    
    /* Filter Tabs */
    .filter-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .filter-tab {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* Product Grid */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    /* Product Card */
    .product-card .card-content {
        padding: 16px;
    }
    
    .product-card .product-title {
        font-size: 14px;
    }
    
    /* Admin Stats */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    /* Admin Topbar */
    .admin-topbar {
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .topbar-search {
        width: 100%;
        order: 3;
    }
    
    .topbar-actions {
        margin-left: auto;
    }
    
    /* Auth Pages */
    .auth-card {
        padding: 32px 24px;
        margin: 0 16px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    /* Cart Page */
    .cart-layout {
        grid-template-columns: 1fr;
    }
    
    .cart-summary {
        position: static;
    }
    
    /* Checkout Page */
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    
    /* Product Detail */
    .product-detail-layout {
        grid-template-columns: 1fr;
    }
    
    .product-gallery {
        order: 1;
    }
    
    .product-info {
        order: 2;
    }
    
    .empty-state h3 {
        font-size: 18px;
    }
}

/* ===== Mobile Portrait (max-width: 576px) ===== */
@media (max-width: 576px) {
    /* Typography */
    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
    h3 { font-size: 20px; }
    h4 { font-size: 16px; }
    
    body {
        font-size: 14px;
    }
    
    /* Header - even more compact */
    .header-actions {
        gap: 10px;
    }
    
    .header-auth-btn {
        padding: 8px !important;
        min-width: 44px;
        height: 36px;
    }
    
    .header-auth-btn .btn-icon {
        width: 22px;
        height: 22px;
    }
    
    .mobile-search-btn {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    
    .mobile-search-btn svg {
        width: 24px;
        height: 24px;
        stroke: #ffffff;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
    }
    
    .header-cart-btn {
        width: 36px;
        height: 36px;
    }
    
    /* Buttons - full width on small screens */
    .btn-block-mobile {
        width: 100%;
    }
    
    /* Two column buttons */
    .btn-group-mobile {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
    }
    
    /* Form groups stack */
    .form-row {
        grid-template-columns: 1fr !important;
    }
    
    /* Footer */
    .footer-social {
        justify-content: center;
    }
    
    /* Dropdown - Bottom Sheet Style */
    .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 20px;
        min-width: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px;
        transform: translateY(100%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 1002;
        pointer-events: none !important;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    }
    
    /* Override hover behavior on mobile */
    .user-menu:hover .dropdown-menu {
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(100%) !important;
        pointer-events: none !important;
    }
    
    .dropdown-menu.show,
    .user-menu .dropdown-menu.show {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    
    .dropdown-menu::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
    }
    
    .dropdown-item {
        padding: 16px;
        font-size: 16px;
    }
    
    /* Pagination - fewer visible */
    .pagination {
        gap: 4px;
    }
    
    .pagination a,
    .pagination span {
        width: 34px;
        height: 34px;
        font-size: 12px;
        border-radius: 8px;
    }
    
    /* Modal - full screen on mobile */
    .modal {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .modal-overlay {
        padding: 0;
    }
    
    /* Product Grid - Single Column */
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    /* Hero */
    .hero {
        padding: 60px 0 40px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    /* Cart Item */
    .cart-item {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .cart-item-image {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .cart-item-actions {
        width: 100%;
        justify-content: center;
    }
    
    /* Quick Links Grid */
    .quick-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .quick-link-card {
        padding: 20px 16px;
    }
    
    .quick-link-icon {
        width: 48px;
        height: 48px;
    }
    
    .quick-link-card h4 {
        font-size: 14px;
    }
    
    .quick-link-card p {
        font-size: 12px;
    }
    
    /* Auth Form */
    .auth-card {
        padding: 24px 20px;
        border-radius: 20px;
    }
    
    .auth-logo {
        width: 50px;
        height: 50px;
    }
    
    /* Ticket System */
    .ticket-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .ticket-actions {
        width: 100%;
    }
    
    .ticket-actions .btn {
        width: 100%;
    }
}

/* ===== Extra Small Devices (max-width: 400px) ===== */
@media (max-width: 400px) {
    .container {
        padding: 0 12px;
    }
    
    h1 { font-size: 24px; }
    h2 { font-size: 22px; }
    
    .btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .header-cart-btn {
        width: 40px;
        height: 44px;
    }
    
    .cart-count {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    /* Quick Links - Single Column */
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
    
    /* Auth */
    .auth-card {
        padding: 20px 16px;
    }
    
    .auth-title {
        font-size: 22px;
    }
    
    /* Stats */
    .stat-card {
        padding: 16px;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-bottom: 12px;
    }
}

/* ===== Landscape Orientation Fixes ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 8px 0;
    }
    
    .main-content {
        padding-top: 70px;
    }
    
    .modal {
        max-height: 100vh;
    }
}

/* ===== Mobile Navigation Overlay ===== */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--dark);
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: 80px 24px 24px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav-content {
    flex: 1;
}

.mobile-nav-link {
    display: block;
    padding: 16px 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--gray-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: color 0.3s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--white);
}

.mobile-nav-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: var(--dark-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-nav-close:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.mobile-nav-footer {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 24px;
    margin-bottom: 15px;
}

.mobile-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: var(--white);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mobile-nav-btn:hover {
    background: var(--primary-dark);
}

/* ===== Touch Device Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn {
        min-height: 40px;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .dropdown-item {
        padding: 14px 16px;
    }
    
    .footer-links li {
        margin-bottom: 16px;
    }
    
    /* Remove hover effects on touch */
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .footer-social a:hover {
        transform: none;
    }
}

/* ===== iOS Safe Area Support ===== */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: calc(16px + env(safe-area-inset-top));
    }
    
    .footer-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .mobile-nav {
        padding-top: calc(100px + env(safe-area-inset-top));
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ===== Dark Mode Preference (if system light mode) ===== */
/* Uncomment if you want to support system theme preference */
/*
@media (prefers-color-scheme: light) {
    :root {
        --dark: #ffffff;
        --dark-light: #f8f9fa;
        --dark-lighter: #e9ecef;
        --white: #0f0f14;
        --gray: #6b7280;
        --gray-light: #4b5563;
    }
}
*/

/* ===== Reduced Motion Preference ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .fade-up,
    .fade-in,
    .scale-in,
    .slide-left,
    .slide-right {
        opacity: 1;
        transform: none;
    }
    
    .page-loader {
        display: none;
    }
}

/* ===== Print Styles ===== */
@media print {
    .header,
    .footer,
    .page-loader,
    .mobile-menu-btn,
    .header-cart-btn,
    .btn {
        display: none !important;
    }
    
    .main-content {
        padding-top: 0;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

/* ===== Dropdown Show States ===== */
.dropdown-menu {
    transition: all 0.3s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown backdrop for mobile */
@media (max-width: 576px) {
    .dropdown-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
    }
}

/* ===== Touch Device Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn {
        min-height: 44px;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .dropdown-item {
        padding: 14px 16px;
        min-height: 48px;
    }
    
    .footer-links li {
        margin-bottom: 16px;
    }
    
    /* Remove hover effects on touch */
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .footer-social a:hover {
        transform: none;
    }
    
    /* Disable hover dropdown on touch */
    .user-menu:hover .dropdown-menu {
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
    }
    
    .user-menu .dropdown-menu.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    /* Better scrolling */
    .table-wrapper {
        scroll-snap-type: x proximity;
    }
    
    /* Prevent accidental double-tap zoom */
    .btn,
    .dropdown-item,
    .nav-link,
    .mobile-nav-link {
        touch-action: manipulation;
    }
}

/* ===== iOS Safe Area Support ===== */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: calc(16px + env(safe-area-inset-top));
    }
    
    .footer-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .mobile-nav {
        padding-top: calc(80px + env(safe-area-inset-top));
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .dropdown-menu {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .admin-sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ===== Landscape Orientation Fixes ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 8px 0;
    }
    
    .main-content {
        padding-top: 70px;
    }
    
    .modal {
        max-height: 100vh;
    }
    
    .mobile-nav {
        padding-top: 60px;
    }
    
    .mobile-nav-link {
        padding: 12px 0;
        font-size: 16px;
    }
    
    .hero {
        padding: 40px 0;
    }
}

/* ===== Reduced Motion Preference ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .fade-up,
    .fade-in,
    .scale-in,
    .slide-left,
    .slide-right {
        opacity: 1;
        transform: none;
    }
    
    .page-loader {
        display: none;
    }
    
    .mobile-nav,
    .dropdown-menu,
    .admin-sidebar,
    .dashboard-sidebar {
        transition: none;
    }
}

/* ===== Accessibility Focus States ===== */
.btn:focus-visible,
.dropdown-item:focus-visible,
.nav-link:focus-visible,
.mobile-nav-link:focus-visible,
.user-avatar:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== High Contrast Mode ===== */
@media (prefers-contrast: high) {
    .card,
    .dropdown-menu,
    .modal,
    .btn-secondary {
        border-width: 2px;
    }
    
    .nav-link,
    .dropdown-item {
        text-decoration: underline;
    }
}

/* ===== Tooltip Touch Support ===== */
[data-tooltip].tooltip-active::before {
    opacity: 1;
    visibility: visible;
}

/* ===== Action Dropdowns in Tables ===== */
.action-dropdown {
    position: relative;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--dark-lighter);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--gray-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    color: var(--white);
    border-color: var(--primary);
}

.action-dropdown .dropdown-menu {
    min-width: 160px;
    right: 0;
    left: auto;
}

@media (max-width: 576px) {
    .action-dropdown .dropdown-menu {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        min-width: 100% !important;
        border-radius: 20px 20px 0 0;
    }
}

/* ===== Admin Panel Mobile Styles ===== */
@media (max-width: 1024px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-main {
        padding: 20px;
        min-height: auto;
    }
    
    .admin-topbar {
        position: sticky;
        top: 0;
        background: var(--dark);
        z-index: 50;
        padding: 16px 0;
        margin: -20px -20px 20px;
        padding: 16px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .dashboard-card {
        padding: 20px;
    }
    
    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* ===== Chat Widget Mobile Styles ===== */
@media (max-width: 576px) {
    .chat-widget {
        bottom: 16px;
        right: 16px;
    }
    
    .chat-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .chat-toggle {
        width: 56px;
        height: 56px;
    }
}
