/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Show only on mobile */
@media (max-width: 767px) {
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    
    /* Add padding to body so content doesn't get hidden behind nav */
    body {
        padding-bottom: 70px;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-size: 10px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    min-width: 60px;
}

.mobile-nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.mobile-nav-item span {
    margin-top: 2px;
}

.mobile-nav-item:hover,
.mobile-nav-item:active {
    color: #8B0000;
    background: rgba(139, 0, 0, 0.05);
}

.mobile-nav-item.active {
    color: #8B0000;
}

.mobile-nav-item.active svg {
    stroke-width: 2;
}

/* Dark mode */
body.dark-theme .mobile-bottom-nav {
    background: #1a1a1a;
    border-top: 1px solid #333;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .mobile-nav-item {
    color: #999;
}

body.dark-theme .mobile-nav-item:hover,
body.dark-theme .mobile-nav-item:active {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
}

body.dark-theme .mobile-nav-item.active {
    color: #d4af37;
}

/* RTL Support */
body.rtl .mobile-bottom-nav {
    direction: rtl;
}

/* Hide TikTok toggle and profile elements on mobile (they're in bottom nav now) */
@media (max-width: 767px) {
    .nav-tiktok-toggle,
    .profile-dropdown-container {
        display: none !important;
    }
}

/* Mobile Profile Sheet */
.mobile-profile-sheet {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

@media (max-width: 767px) {
    .mobile-profile-sheet {
        display: block;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-profile-sheet.active {
        pointer-events: auto;
        opacity: 1;
    }
}

.mobile-profile-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-profile-sheet.active .mobile-profile-backdrop {
    opacity: 1;
}

.mobile-profile-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    padding: 12px 20px 30px;
    padding-bottom: calc(30px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-profile-sheet.active .mobile-profile-content {
    transform: translateY(0);
}

.mobile-profile-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 0 auto 16px;
}

.mobile-profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
    margin-bottom: 12px;
}

.mobile-profile-phone {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.mobile-profile-label {
    font-size: 12px;
    color: #888;
}

.mobile-profile-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-profile-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    border: none;
    background: #f8f8f8;
    border-radius: 12px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.mobile-profile-option:hover,
.mobile-profile-option:active {
    background: #f0f0f0;
}

.mobile-profile-option.logout {
    color: #c0392b;
}

.mobile-profile-option.logout svg {
    stroke: #c0392b;
}

.mobile-profile-option span {
    flex: 1;
}

/* Theme Switch */
.mobile-theme-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.mobile-theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mobile-theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.mobile-theme-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.mobile-theme-switch input:checked + .mobile-theme-slider {
    background-color: #8B0000;
}

.mobile-theme-switch input:checked + .mobile-theme-slider:before {
    transform: translateX(22px);
}

/* Dark mode for profile sheet */
body.dark-theme .mobile-profile-content {
    background: #1a1a1a;
}

body.dark-theme .mobile-profile-handle {
    background: #444;
}

body.dark-theme .mobile-profile-header {
    border-bottom-color: #333;
}

body.dark-theme .mobile-profile-phone {
    color: #eee;
}

body.dark-theme .mobile-profile-label {
    color: #888;
}

body.dark-theme .mobile-profile-option {
    background: #2a2a2a;
    color: #eee;
}

body.dark-theme .mobile-profile-option:hover,
body.dark-theme .mobile-profile-option:active {
    background: #333;
}

body.dark-theme .mobile-profile-option svg {
    stroke: #eee;
}

body.dark-theme .mobile-profile-option.logout {
    color: #e74c3c;
}

body.dark-theme .mobile-profile-option.logout svg {
    stroke: #e74c3c;
}

body.dark-theme .mobile-theme-switch input:checked + .mobile-theme-slider {
    background-color: #d4af37;
}

/* ========================================
   Mobile Filter FAB (Floating Action Button)
   ======================================== */

.mobile-filter-fab {
    display: none;
    position: fixed;
    bottom: 120px; /* Above the bottom nav */
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B0000, #a00000);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.4);
    cursor: pointer;
    z-index: 999;
    transition: transform 0.2s, box-shadow 0.2s;
    align-items: center;
    justify-content: center;
}

.mobile-filter-fab svg {
    width: 24px;
    height: 24px;
    stroke: white;
    fill: none;
    stroke-width: 2;
}

.mobile-filter-fab:hover,
.mobile-filter-fab:active {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(139, 0, 0, 0.5);
}

.mobile-filter-fab.has-filters {
    background: linear-gradient(135deg, #d4af37, #b8941f);
}

.mobile-filter-fab .filter-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fff;
    color: #8B0000;
    font-size: 11px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (max-width: 767px) {
    .mobile-filter-fab {
        display: flex;
    }
    
    /* Hide the entire filter section on mobile - we use the FAB instead */
    .filter-section {
        display: none !important;
    }
    
    /* Add margin to all-plates section since filter section is hidden */
    .all-plates-section {
        margin-top: 20px;
    }
}

/* Mobile Filter Modal (Bottom Sheet) */
.mobile-filter-sheet {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

@media (max-width: 767px) {
    .mobile-filter-sheet {
        display: block;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-filter-sheet.active {
        pointer-events: auto;
        opacity: 1;
    }
}

.mobile-filter-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filter-sheet.active .mobile-filter-backdrop {
    opacity: 1;
}

.mobile-filter-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    padding: 12px 20px 30px;
    padding-bottom: calc(30px + env(safe-area-inset-bottom));
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-filter-sheet.active .mobile-filter-content {
    transform: translateY(0);
}

.mobile-filter-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 0 auto 16px;
}

.mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mobile-filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.mobile-filter-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 4px;
}

.mobile-filter-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mobile-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.mobile-filter-group select,
.mobile-filter-group input[type="text"],
.mobile-filter-group input[type="number"] {
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #f8f8f8;
    color: #333;
    width: 100%;
    box-sizing: border-box;
}

.mobile-filter-group select:focus,
.mobile-filter-group input:focus {
    outline: none;
    border-color: #8B0000;
    background: #fff;
}

.mobile-filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.mobile-filter-checkboxes label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #333;
    font-weight: normal;
}

.mobile-filter-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8B0000;
}

.mobile-filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.mobile-filter-apply,
.mobile-filter-reset {
    flex: 1;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.mobile-filter-apply {
    background: linear-gradient(135deg, #8B0000, #a00000);
    color: white;
}

.mobile-filter-apply:active {
    transform: scale(0.98);
}

.mobile-filter-reset {
    background: #f0f0f0;
    color: #555;
}

.mobile-filter-reset:active {
    background: #e5e5e5;
}

/* Dark mode for filter sheet */
body.dark-theme .mobile-filter-content {
    background: #1a1a1a;
}

body.dark-theme .mobile-filter-handle {
    background: #444;
}

body.dark-theme .mobile-filter-title {
    color: #eee;
}

body.dark-theme .mobile-filter-close {
    color: #999;
}

body.dark-theme .mobile-filter-group label {
    color: #bbb;
}

body.dark-theme .mobile-filter-group select,
body.dark-theme .mobile-filter-group input[type="text"],
body.dark-theme .mobile-filter-group input[type="number"] {
    background: #2a2a2a;
    border-color: #444;
    color: #eee;
}

body.dark-theme .mobile-filter-group select:focus,
body.dark-theme .mobile-filter-group input:focus {
    border-color: #d4af37;
    background: #333;
}

body.dark-theme .mobile-filter-checkboxes label {
    color: #ddd;
}

body.dark-theme .mobile-filter-checkboxes input[type="checkbox"] {
    accent-color: #d4af37;
}

body.dark-theme .mobile-filter-apply {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #1a1a1a;
}

body.dark-theme .mobile-filter-reset {
    background: #333;
    color: #ccc;
}

body.dark-theme .mobile-filter-reset:active {
    background: #444;
}

body.dark-theme .mobile-filter-fab {
    background: linear-gradient(135deg, #d4af37, #b8941f);
}

body.dark-theme .mobile-filter-fab .filter-count {
    background: #1a1a1a;
    color: #d4af37;
}

/* ========================================
   About Us Modal
   ======================================== */

.about-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.about-modal.active {
    display: block;
    pointer-events: auto;
    opacity: 1;
}

.about-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.about-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.about-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    z-index: 5;
    transition: background 0.2s;
}

.about-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.about-modal-body {
    padding: 30px 25px;
    text-align: center;
}

.about-modal-body h2 {
    font-size: 28px;
    font-weight: 700;
    color: #8B0000;
    margin-bottom: 8px;
}

.about-tagline {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
}

.about-section {
    text-align: left;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 10px;
}

.about-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #8B0000;
    margin-bottom: 10px;
}

.about-section p {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 8px;
}

.about-section p:last-child {
    margin-bottom: 0;
}

.about-cta {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.about-cta p {
    font-size: 13px;
    color: #888;
    font-style: italic;
}

/* Dark mode */
body.dark-theme .about-modal-content {
    background: #1a1a1a;
}

body.dark-theme .about-modal-close {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

body.dark-theme .about-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

body.dark-theme .about-modal-body h2 {
    color: #d4af37;
}

body.dark-theme .about-tagline {
    color: #999;
}

body.dark-theme .about-section {
    background: #2a2a2a;
}

body.dark-theme .about-section h3 {
    color: #d4af37;
}

body.dark-theme .about-section p {
    color: #ccc;
}

body.dark-theme .about-cta {
    border-top-color: #333;
}

body.dark-theme .about-cta p {
    color: #777;
}

/* ========================================
   Mobile Favorites Modal - Bottom Sheet Style
   ======================================== */

@media (max-width: 767px) {
    .favorites-modal {
        align-items: flex-end !important;
        justify-content: flex-end !important;
        pointer-events: none;
        background: rgba(0, 0, 0, 0) !important;
        transition: background 0.3s ease !important;
    }
    
    .favorites-modal.active {
        pointer-events: auto;
        background: rgba(0, 0, 0, 0.5) !important;
    }
    
    .favorites-modal .favorites-modal-content {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 85vh !important;
        border-radius: 20px 20px 0 0 !important;
        transform: translateY(100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    .favorites-modal.active .favorites-modal-content {
        transform: translateY(0) !important;
    }
    
    /* Add handle at top */
    .favorites-modal .favorites-modal-content::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 12px auto 8px;
    }
    
    .favorites-modal .favorites-modal-header {
        padding: 8px 20px 16px !important;
        border-bottom: 1px solid #eee;
    }
    
    .favorites-modal .favorites-modal-header h2 {
        font-size: 18px !important;
        margin: 0;
    }
    
    .favorites-modal .close-modal {
        position: absolute;
        top: 12px;
        right: 12px;
        background: rgba(0, 0, 0, 0.1);
        border: none;
        font-size: 20px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #666;
    }
    
    .favorites-modal .favorites-modal-body {
        padding: 16px 20px !important;
        padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
        overflow-y: auto;
        max-height: calc(85vh - 80px);
    }
    
    .favorites-modal .favorites-stats {
        display: flex;
        justify-content: space-between;
        padding: 12px 16px;
        background: #f8f8f8;
        border-radius: 10px;
        margin-bottom: 16px;
        font-size: 14px;
    }
    
    .favorites-modal .favorites-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .favorites-modal .no-favorites {
        text-align: center;
        padding: 40px 20px;
    }
    
    .favorites-modal .no-favorites svg {
        opacity: 0.5;
        margin-bottom: 12px;
    }
    
    .favorites-modal .no-favorites p {
        color: #888;
        font-size: 14px;
    }
}

/* Dark mode for mobile favorites */
@media (max-width: 767px) {
    body.dark-theme .favorites-modal .favorites-modal-content {
        background: #1a1a1a !important;
    }
    
    body.dark-theme .favorites-modal .favorites-modal-content::before {
        background: #444;
    }
    
    body.dark-theme .favorites-modal .favorites-modal-header {
        border-bottom-color: #333;
    }
    
    body.dark-theme .favorites-modal .favorites-modal-header h2 {
        color: #eee;
    }
    
    body.dark-theme .favorites-modal .close-modal {
        background: rgba(255, 255, 255, 0.1);
        color: #ccc;
    }
    
    body.dark-theme .favorites-modal .favorites-stats {
        background: #2a2a2a;
        color: #ccc;
    }
    
    body.dark-theme .favorites-modal .no-favorites p {
        color: #777;
    }
}
