/* Table Of Stickys - Mobile Specific Styles */

/* Mobile-First Approach */
@media (max-width: 968px) {
    
    /* Enhanced Mobile Navigation */
    .tos-sticky-nav {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        background: rgba(44, 62, 80, 0.95);
    }

    .tos-nav-content {
        height: 55px;
        padding: 0 5px;
    }

    .tos-nav-logo {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }

    /* Mobile Toggle Enhanced */
    .tos-mobile-toggle {
        padding: 8px;
        border-radius: 6px;
        background: rgba(255, 140, 0, 0.1);
        font-size: 1.2rem;
        transition: all 0.2s ease;
        touch-action: manipulation;
    }

    .tos-mobile-toggle:active {
        transform: scale(0.95);
        background: rgba(255, 140, 0, 0.2);
    }

    /* Native App-like Mobile Menu */
    .tos-mobile-menu {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 0 0 20px 20px;
        margin: 0 10px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
        opacity: 0;
        visibility: hidden;
    }

    .tos-mobile-menu.active {
        max-height: 500px; /* Increased for better compatibility */
        opacity: 1;
        visibility: visible;
        animation: mobileSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    @keyframes mobileSlideIn {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .tos-mobile-nav-item {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        position: relative;
        overflow: hidden;
    }

    .tos-mobile-nav-item::before {
        content: '';
        position: absolute;
        left: -100%;
        top: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 140, 0, 0.1), transparent);
        transition: left 0.6s ease;
    }

    .tos-mobile-nav-item:hover::before {
        left: 100%;
    }

    .tos-mobile-nav-link {
        color: #333;
        padding: 16px 20px;
        font-size: 1rem;
        font-weight: 500;
        display: flex;
        align-items: center;
        position: relative;
        touch-action: manipulation;
    }

    .tos-mobile-nav-link::after {
        content: '→';
        position: absolute;
        right: 20px;
        opacity: 0;
        transform: translateX(-10px);
        transition: all 0.3s ease;
        color: #ff8c00;
    }

    .tos-mobile-nav-link:hover::after,
    .tos-mobile-nav-link.active::after {
        opacity: 1;
        transform: translateX(0);
    }

    .tos-mobile-nav-link:hover {
        background: rgba(255, 140, 0, 0.05);
        color: #ff8c00;
        padding-left: 25px;
    }

    .tos-mobile-nav-link.active {
        background: rgba(255, 140, 0, 0.15);
        color: #ff8c00;
        font-weight: 600;
        padding-left: 35px;
        border-left: 4px solid #ff8c00;
        position: relative;
        box-shadow: inset 0 0 10px rgba(255, 140, 0, 0.1);
    }

    .tos-mobile-nav-link.active::before {
        content: '👁️‍🗨️';
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        animation: mobileReadingPulse 2s infinite;
        font-size: 1.1em;
    }

    @keyframes mobileReadingPulse {
        0%, 100% { 
            opacity: 1; 
            transform: translateY(-50%) scale(1);
        }
        50% { 
            opacity: 0.7; 
            transform: translateY(-50%) scale(1.05);
        }
    }

    /* Mobile Reading Progress */
    .tos-reading-progress-container {
        bottom: -3px;
        height: 3px;
    }

    .tos-reading-progress {
        background: linear-gradient(90deg, #ff8c00, #ff6b6b);
        border-radius: 0;
        height: 100%;
    }

    /* Mobile Current Reading Indicator */
    .tos-current-reading {
        top: 65px;
        right: 10px;
        left: 10px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 15px;
        padding: 12px 16px;
        text-align: center;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        transform: translateY(-100px);
        opacity: 0;
        transition: all 0.3s ease;
    }

    .tos-current-reading.visible {
        transform: translateY(0);
        opacity: 1;
    }

    .tos-reading-text {
        font-size: 0.9rem;
        font-weight: 500;
    }

    /* Mobile Progress Circle - Bottom Right */
    .tos-progress-circle {
        top: auto;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        background: rgba(255, 140, 0, 0.9);
        border: 3px solid white;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        transform: scale(0);
        animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    }

    @keyframes bounceIn {
        0% {
            transform: scale(0);
        }
        50% {
            transform: scale(1.1);
        }
        100% {
            transform: scale(1);
        }
    }

    .tos-progress-text {
        color: white;
        font-weight: bold;
        font-size: 11px;
    }

    /* Touch Improvements */
    .tos-mobile-nav-link,
    .tos-mobile-toggle {
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
    }

    /* Dark Theme Mobile */
    .tos-widget-container[data-theme="dark"] .tos-mobile-menu {
        background: rgba(30, 30, 30, 0.98);
    }

    .tos-widget-container[data-theme="dark"] .tos-mobile-nav-link {
        color: #fff;
    }

    .tos-widget-container[data-theme="dark"] .tos-mobile-nav-item {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .tos-widget-container[data-theme="dark"] .tos-current-reading {
        background: rgba(30, 30, 30, 0.95);
        color: white;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
    
    .tos-nav-container {
        padding: 0 10px;
    }

    .tos-nav-content {
        height: 50px;
    }

    .tos-nav-logo {
        font-size: 0.9rem;
        max-width: 150px;
    }

    .tos-mobile-toggle {
        font-size: 1.1rem;
        padding: 6px;
    }

    .tos-mobile-menu {
        margin: 0 5px;
        border-radius: 0 0 15px 15px;
    }

    .tos-mobile-nav-link {
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    .tos-current-reading {
        top: 55px;
        left: 5px;
        right: 5px;
        padding: 10px 12px;
    }

    .tos-reading-text {
        font-size: 0.85rem;
    }

    .tos-progress-circle {
        width: 45px;
        height: 45px;
        right: 15px;
        bottom: 15px;
    }

    .tos-progress-text {
        font-size: 10px;
    }
}

/* Landscape Mobile */
@media (max-width: 968px) and (orientation: landscape) {
    
    .tos-nav-content {
        height: 45px;
    }

    .tos-nav-logo {
        font-size: 0.9rem;
    }

    .tos-mobile-toggle {
        font-size: 1rem;
        padding: 5px;
    }

    .tos-current-reading {
        top: 50px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    .tos-progress-circle {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }

    .tos-progress-text {
        font-size: 9px;
    }
}

/* High DPI Mobile Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    
    .tos-sticky-nav {
        border-bottom-width: 2px;
    }

    .tos-mobile-nav-item {
        border-bottom-width: 0.5px;
    }
}

/* iOS Safari Specific */
@supports (-webkit-touch-callout: none) {
    
    .tos-sticky-nav {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .tos-mobile-menu {
        -webkit-overflow-scrolling: touch;
    }
}

/* Android Chrome Specific */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm) {
    
    .tos-mobile-toggle {
        font-size: 1.3rem;
    }
}

/* Accessibility - High Contrast */
@media (prefers-contrast: high) {
    
    .tos-mobile-menu {
        background: rgba(255, 255, 255, 1);
        border: 2px solid #333;
    }

    .tos-mobile-nav-link {
        color: #000;
        border-bottom: 1px solid #333;
    }

    .tos-mobile-nav-link:hover,
    .tos-mobile-nav-link.active {
        background: #000;
        color: #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    
    .tos-mobile-menu,
    .tos-mobile-nav-link,
    .tos-current-reading,
    .tos-progress-circle {
        animation: none;
        transition: none;
    }
} 