/* ============================================
   TORWASH - Responsive Mobile Styles
   ============================================ */

/* --- Bottom Navigation Bar (Mobile) --- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    z-index: 40;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    font-size: 10px;
    color: #6b7280;
    text-decoration: none;
    border-radius: 8px;
    transition: color 0.2s;
    min-width: 56px;
}

.bottom-nav-item i {
    font-size: 18px;
}

.bottom-nav-item.active {
    color: #3BAAEB;
}

.bottom-nav-item:active {
    background: #f3f4f6;
}

/* --- Responsive Table to Cards --- */
.responsive-table-wrapper {
    position: relative;
}

.mobile-cards {
    display: none;
}

.mobile-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.mobile-card-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
}

.mobile-card-label {
    color: #6b7280;
    font-size: 12px;
}

.mobile-card-value {
    font-weight: 500;
    color: #1f2937;
    text-align: right;
}

.mobile-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
    justify-content: flex-end;
}

/* --- Mobile scroll hint for tables --- */
.table-scroll-hint {
    display: none;
    text-align: center;
    padding: 8px;
    color: #9ca3af;
    font-size: 12px;
}

.table-scroll-hint i {
    margin-right: 4px;
    animation: scrollHint 1.5s ease-in-out infinite;
}

@keyframes scrollHint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* ============================================
   MEDIA QUERIES
   ============================================ */

@media (max-width: 1023px) {
    /* Show bottom nav */
    .bottom-nav {
        display: block;
    }

    /* Add bottom padding so content isn't hidden behind bottom nav */
    main {
        padding-bottom: 80px !important;
    }

    /* Footer hidden on mobile (bottom nav replaces it) */
    footer {
        display: none;
    }
}

@media (max-width: 767px) {
    /* Show mobile cards, hide desktop tables */
    .mobile-cards {
        display: block;
    }

    .desktop-table {
        display: none;
    }

    /* Show scroll hint for tables that remain */
    .table-scroll-hint {
        display: block;
    }

    /* Stat cards: smaller text on very small screens */
    .stat-card p.text-3xl {
        font-size: 1.5rem;
    }

    /* Modal improvements */
    .modal > div:last-child:not(.absolute) {
        margin: 8px;
        max-height: calc(100vh - 16px);
    }

    /* Filter sections: stack vertically */
    .filter-stack {
        flex-direction: column;
        align-items: stretch !important;
    }

    .filter-stack > * {
        width: 100% !important;
    }

    /* Pagination mobile */
    .pagination-mobile {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* Even smaller stat cards */
    .stat-card p.text-3xl {
        font-size: 1.25rem;
    }

    /* Header actions: tighter spacing */
    header .flex.items-center.gap-2,
    header .flex.items-center.gap-3,
    header .flex.items-center.gap-4 {
        gap: 6px;
    }

    /* Cards: less padding */
    .bg-white.rounded-2xl.p-6 {
        padding: 14px;
    }

    /* Smaller icons in stat cards */
    .stat-card .w-14 {
        width: 40px;
        height: 40px;
    }

    .stat-card .w-14 i {
        font-size: 1rem;
    }
}

/* ============================================
   CONFIGURACIÓN PAGE - Mobile Fixes
   ============================================ */

@media (max-width: 1023px) {
    /* Config tabs container: horizontal scroll with hidden scrollbar */
    .config-tab {
        width: auto !important;
        flex-shrink: 0;
        padding: 10px 14px !important;
        font-size: 13px;
        border-radius: 20px !important;
        gap: 6px !important;
        background: #f3f4f6;
    }

    .config-tab span {
        display: none;
    }

    .config-tab i {
        width: auto !important;
        font-size: 16px;
    }

    .config-tab.active {
        background: #E8F4FC !important;
    }

    .config-tab.active span {
        display: inline;
    }

    /* Hide scrollbar on config tabs nav */
    nav.overflow-x-auto {
        -ms-overflow-style: none;
        scrollbar-width: none;
        padding-bottom: 4px !important;
    }

    nav.overflow-x-auto::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 767px) {
    /* Section headers: stack title and button vertically */
    .config-header-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .config-header-actions button {
        width: 100%;
        justify-content: center;
    }

    /* Config section inner padding */
    .config-section .p-6 {
        padding: 14px !important;
    }

    /* Category/Vehicle items: stack on very small screens */
    .config-list-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .config-list-item > .flex:last-child {
        align-self: flex-end;
    }

    /* Users table: hide and show cards */
    .config-users-table {
        display: none;
    }

    .config-users-cards {
        display: block !important;
    }
}

/* Config users mobile cards (hidden by default) */
.config-users-cards {
    display: none;
}

.config-user-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}

.config-user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.config-user-card-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-user-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.config-user-card-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

/* ============================================
   SWIPE INDICATOR
   ============================================ */
.sidebar-swipe-indicator {
    display: none;
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60px;
    background: rgba(59, 170, 235, 0.3);
    border-radius: 0 4px 4px 0;
    z-index: 15;
    transition: opacity 0.3s;
}

@media (max-width: 1023px) {
    .sidebar-swipe-indicator {
        display: block;
    }

    /* Hide when sidebar is open */
    .sidebar-open .sidebar-swipe-indicator {
        display: none;
    }
}

/* ============================================
   PULL TO REFRESH AREA (visual only)
   ============================================ */
.mobile-header-spacer {
    display: none;
}

@media (max-width: 1023px) {
    .mobile-header-spacer {
        display: block;
        height: 0;
    }
}
