/* Mobile-specific styles for streams page */

@media (max-width: 767px) {
    /* Clean Mobile Menu Bar - No Background Container */
    .streams-tabs-container {
        display: flex;
        gap: 6px; /* Small gap for shadow space */
        margin: 1rem auto 1.5rem auto;
        padding: 0;
        justify-content: center;
        flex-wrap: wrap; /* Allow wrapping on mobile */
        max-width: 100%;
        position: relative;
    }

    /* Mobile menu tabs with enhanced shadows */
    .streams-tab {
        background: linear-gradient(135deg, rgba(20, 20, 20, 0.9) 0%, rgba(0, 0, 0, 0.95) 50%, rgba(20, 20, 20, 0.9) 100%);
        padding: 14px 18px;
        font-size: 0.95rem;
        min-width: auto;
        flex: 1;
        min-height: 50px;
        border-radius: 10px;
        margin: 0;
        letter-spacing: 0.3px;
        backdrop-filter: blur(8px);
        /* Enhanced mobile shadows */
        box-shadow: 
            0 6px 20px rgba(0, 0, 0, 0.5),
            0 3px 12px rgba(0, 0, 0, 0.4),
            0 1px 6px rgba(0, 0, 0, 0.3),
            inset 0 1px 2px rgba(255, 255, 255, 0.08);
    }

    /* Enhanced mobile hover effects with stronger shadows */
    .streams-tab:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 
            0 10px 30px rgba(0, 0, 0, 0.6),
            0 6px 20px rgba(0, 0, 0, 0.5),
            0 3px 12px rgba(0, 0, 0, 0.4),
            0 0 20px rgba(255, 255, 255, 0.08),
            inset 0 2px 4px rgba(255, 255, 255, 0.1);
        background: linear-gradient(135deg, rgba(35, 35, 35, 0.95) 0%, rgba(15, 15, 15, 1) 50%, rgba(35, 35, 35, 0.95) 100%);
    }

    /* Mobile active/tap states */
    .streams-tab:active {
        transform: translateY(-1px) scale(0.98);
        transition: transform 0.1s ease;
        box-shadow: 
            0 4px 15px rgba(0, 0, 0, 0.5),
            0 2px 8px rgba(0, 0, 0, 0.3),
            inset 0 1px 2px rgba(255, 255, 255, 0.08);
    }
    /* Background optimization */
    body.streams-page {
        background-size: 200% 200%;
        animation: subtleBackgroundGlow 15s ease-in-out infinite;
    }

    /* Card adjustments */
    .stream-card {
        min-height: auto;
        height: 100%;
    }

    .hamburger-dropdown .nav-link:hover,
    .hamburger-dropdown .nav-link:active {
        background: linear-gradient(to right, transparent 0%, rgba(0, 87, 246, 0.15) 50%, transparent 100%);
        color: #0057F6;
        transform: translateY(-1px);
    }
    
    /* Text adjustments */
    .card-title {
        font-size: 1.1rem;
        margin-bottom: 0.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition-duration: 0.2s;
    }
    
    .stream-title {
        font-size: 0.9rem;
        margin-bottom: 0.25rem; /* Reduced from 0.5rem to 0.25rem */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition-duration: 0.2s;
    }

    /* Smaller thumbnails */
    .stream-thumbnail-wrapper {
        height: 160px;
        touch-action: manipulation;
    }

    .stream-thumbnail {
        transform: translateZ(0);
        transition: opacity 0.3s ease-out;
    }

    /* Element size adjustments */
    .access-clips-btn {
        padding: 8px 0;
        font-size: 0.9rem;
        width: 100%;
        margin-top: 0.25rem; /* Reduced from 0.5rem to 0.25rem */
        transition-duration: 0.2s;
    }

    /* Hide old live indicator on mobile */
    .live-indicator {
        display: none !important;
    }

    .expiry-badge {
        padding: 2px 8px;
        font-size: 0.75rem;
        top: 8px;
        right: 8px;
    }

    /* Layout adjustments */
    .card-body {
        height: calc(100% - 160px);
    }

    /* Better spacing */
    .row {
        margin-right: -10px;
        margin-left: -10px;
    }
    
    .col, .col-sm-6, .col-md-4, .col-lg-3 {
        padding-right: 10px;
        padding-left: 10px;
    }

    /* Ensure navbar is pure black */
    .navbar {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    }

    /* Add stream-date mobile adjustments */
    .stream-date {
        font-size: 0.9rem;
        padding: 6px 10px;
        min-width: 80px;
    }

    /* Mobile navbar button optimization */
    .navbar .btn {
        padding: 5px 8px;
        font-size: 0.85rem;
        line-height: 1.4;
        white-space: nowrap;
    }
    
    /* Specific optimizations for the subscription button */
    .subscribe-btn {
        padding: 5px 8px !important;
        font-size: 0.85rem !important;
        letter-spacing: -0.2px;
        margin-right: 5px !important; /* Reduced from 6px to 5px to bring buttons slightly closer */
        vertical-align: middle !important; /* Ensure vertical alignment */
        line-height: 1.4 !important; /* Match line height with login button */
    }
    
    .subscribe-btn .fa-crown {
        margin-right: 3px !important;
    }
    
    /* Login button on mobile */
    .auth-buttons .btn {
        padding: 5px 8px;
        font-size: 0.78rem; /* Slightly smaller font for login button */
        letter-spacing: -0.3px; /* Tighter letter spacing */
        vertical-align: middle !important; /* Ensure vertical alignment */
    }
    
    /* Ensure buttons are properly aligned */
    .navbar .d-flex {
        gap: 5px; /* Consistent gap between buttons */
    }

    /* Container for buttons alignment */
    .navbar-dark .navbar-brand + div {
        display: flex !important;
        align-items: center !important; /* Perfect vertical alignment */
    }

    /* Mobile adjustments for How AutoClips Works tab */
    .how-it-works-tab {
        transform: translateY(-10%); /* Reduced from -20% to -10% for more visibility on mobile */
        overflow: hidden; /* Prevent container corners from peeking */
        background: transparent; /* Ensure container is fully transparent */
        border-radius: 0; /* Square edges - no rounded corners */
        width: 50%; /* Make it take up half the width */
        left: 0 !important; /* Force left alignment */
    }
    
    .how-it-works-link {
        background: linear-gradient(135deg, #1a1a1a 0%, #000000 50%, #1a1a1a 100%); /* Rich black gradient for mobile */
        padding: 14px 15px 6px;
        font-size: 0.8rem;
        font-weight: 700;
        border-radius: 0;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6), 0 1px 4px rgba(255, 255, 255, 0.1) inset;
        white-space: nowrap;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
        border-top: 1px solid #333;
        position: relative;
        overflow: hidden;
    }

    .how-it-works-link:hover {
        background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #2a2a2a 100%);
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8), 0 1px 6px rgba(255, 255, 255, 0.15) inset;
        transform: translateY(-1px);
    }
    
    /* Show shorter text on mobile */
    .how-it-works-link .tab-text-long {
        display: none; /* Hide long text on mobile */
    }
    
    .how-it-works-link .tab-text-short {
        display: inline; /* Show short text on mobile */
    }

    /* Mobile adjustments for Request a Stream tab */
    .request-stream-tab {
        transform: translateY(-10%);
        overflow: hidden;
        background: transparent;
        border-radius: 0; /* Square edges - no rounded corners */
        width: 50%; /* Make it take up half the width */
        left: 50% !important; /* Position at right half */
    }
    
    .request-stream-link {
        background: linear-gradient(135deg, #0043b3 0%, #0057F6 50%, #0043b3 100%); /* Rich blue gradient for mobile */
        padding: 14px 15px 6px;
        font-size: 0.8rem;
        font-weight: 700;
        border-radius: 0;
        box-shadow: 0 5px 15px rgba(0, 87, 246, 0.4), 0 1px 4px rgba(255, 255, 255, 0.1) inset;
        white-space: nowrap;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
        border-top: 1px solid #0057F6;
        position: relative;
        overflow: hidden;
    }

    .request-stream-link:hover {
        background: linear-gradient(135deg, #0057F6 0%, #0070ff 50%, #0057F6 100%);
        box-shadow: 0 6px 18px rgba(0, 87, 246, 0.6), 0 1px 6px rgba(255, 255, 255, 0.15) inset;
        transform: translateY(-1px);
    }

    /* User greeting on mobile */
    .user-greeting {
        font-size: 0.8rem;
        max-width: 120px;
    }
    
    .user-greeting span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
        max-width: 100px;
    }
    
    /* Centered user greeting on mobile - between logo and hamburger */
    .user-greeting {
        position: absolute;
        left: 40%; /* Changed from 38% to 40% to move it very slightly more toward hamburger */
        transform: translateX(-50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        z-index: 900;
        max-width: 90px; /* Make narrower to avoid overlap */
    }
    
    /* Add special positioning when free trial button is present */
    .has-trial-btn .user-greeting {
        left: 40%; /* Move more to the left when trial button is present */
        max-width: 100px; /* Make narrower */
    }
    
    /* Make the greeting text smaller when trial button is present */
    .has-trial-btn .user-greeting span {
        font-size: 0.75rem;
        max-width: 80px;
    }
    
    /* Ensure the trial button doesn't get hidden */
    .has-trial-btn .subscribe-btn {
        position: relative;
        z-index: 901; /* Higher than greeting */
    }
    
    .user-greeting i.fa-crown {
        font-size: 0.9rem;
        margin-bottom: 2px;
        filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.5));
    }
    
    .user-greeting span {
        font-size: 0.7rem; /* Smaller text */
        max-width: 80px; /* Constrain width */
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Hamburger button styling */
    .hamburger-menu {
        border: none;
        background: transparent;
        padding: 6px;
        color: white;
        cursor: pointer;
    }
    
    .hamburger-menu .navbar-toggler-icon {
        background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,1)' stroke-width='3' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
        width: 24px;
        height: 24px;
    }
    
    /* Make hamburger more visible when pressed - mobile only */
    .hamburger-menu:active, 
    .hamburger-menu:focus {
        background-color: rgba(255, 255, 255, 0.1);
        outline: none;
    }
    
    /* Mobile dropdown menu */
    .hamburger-dropdown {
        position: fixed;
        top: 56px; /* Adjust based on your navbar height */
        left: 0;
        width: 100%;
        background-color: #111;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
        z-index: 999;
        border-top: 1px solid #333;
        display: none;
        transform: translateY(-20px);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    
    .hamburger-dropdown.show {
        display: block;
        opacity: 1;
        transform: translateY(0);
        animation: dropdownFadeIn 0.3s ease forwards;
    }
    
    @keyframes dropdownFadeIn {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .hamburger-dropdown .navbar-nav {
        padding: 0;
        margin: 0;
        width: 100%;
    }
    
    .hamburger-dropdown .nav-item {
        border-bottom: 1px solid #222;
        text-align: center;
    }
    
    .hamburger-dropdown .nav-item:last-child {
        border-bottom: none;
    }
    
    .hamburger-dropdown .nav-link {
        color: white;
        padding: 15px 20px;
        display: block;
        font-size: 1.1rem;
        text-align: center;
        font-weight: 500;
        letter-spacing: 0.5px;
        background: linear-gradient(to right, transparent 0%, rgba(0, 123, 255, 0.05) 50%, transparent 100%);
        transition: all 0.25s ease;
        width: 100%; /* Ensure full width */
    }
    
    /* Fix for the logout button alignment */
    .hamburger-dropdown .nav-link.btn-link {
        text-align: center;
        justify-content: center;
        width: 100%;
        display: flex;
        align-items: center;
        padding: 15px 20px;
        background: linear-gradient(to right, transparent 0%, rgba(0, 87, 246, 0.05) 50%, transparent 100%);
    }
    
    .hamburger-dropdown .nav-link:hover,
    .hamburger-dropdown .nav-link:active {
        background: linear-gradient(to right, transparent 0%, rgba(0, 123, 255, 0.15) 50%, transparent 100%);
        color: #007bff;
        transform: translateY(-2px);
    }
    
    /* Add subtle pulse animation to the first item for emphasis */
    .hamburger-dropdown .nav-item:first-child .nav-link {
        position: relative;
        overflow: hidden;
    }
    
    .hamburger-dropdown .nav-item:first-child .nav-link::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 120%;
        height: 120%;
        background: radial-gradient(circle, rgba(0, 123, 255, 0.2) 0%, rgba(0, 123, 255, 0) 70%);
        transform: translate(-50%, -50%) scale(0);
        animation: pulseHighlight 2s infinite;
        pointer-events: none;
    }
    
    @keyframes pulseHighlight {
        0% {
            transform: translate(-50%, -50%) scale(0.8);
            opacity: 0;
        }
        50% {
            opacity: 0.5;
        }
        100% {
            transform: translate(-50%, -50%) scale(1.2);
            opacity: 0;
        }
    }

    /* Mobile-specific thumbnail skeleton adjustments */
    .thumbnail-skeleton::after {
        width: 30px;
        height: 30px;
        border-width: 2px;
    }
    
    .thumbnail-skeleton.thumbnail-error::after {
        font-size: 1.5rem;
    }
    
    /* Optimize animations for mobile */
    @keyframes skeleton-loading {
        0% { background-position: -150% 0; }
        100% { background-position: 150% 0; }
    }
    
    /* Faster transition on mobile to improve perceived performance */
    .thumbnail-skeleton.fade-out {
        transition: opacity 0.3s ease;
    }

    /* Hide old positioned tabs since they're now rendered in streams container */
    .how-it-works-tab,
    .request-stream-tab {
        display: none !important;
    }

    /* Mobile Load More Button - unified with streams-tab styling */
    .load-more-container {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.2);
        margin: 1.5rem 0;
        padding: 1.25rem;
        border-radius: 10px;
        backdrop-filter: blur(15px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    
    .load-more-info .text-muted {
        color: rgba(255, 255, 255, 0.9) !important;
        font-weight: 600;
        font-size: 0.9rem;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    }
    
    /* Load More button inherits streams-tab mobile styling */
    .streams-tab.load-more-btn {
        font-size: 1.1rem;
        padding: 20px 24px;
        min-width: auto;
        min-height: 50px;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
        border-radius: 10px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .streams-tab.load-more-btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Start Earning Money tab mobile styling */
    .streams-tab.start-earning-btn {
        background: linear-gradient(135deg, #00C853 0%, #4CAF50 50%, #00C853 100%);
        color: #ffffff;
        border: 2px solid #00C853;
        font-size: 0.9rem;
        padding: 12px 16px;
        letter-spacing: 0.3px;
        font-weight: 700;
    }
    
    .streams-tab.start-earning-btn:hover {
        background: linear-gradient(135deg, #00E676 0%, #00C853 50%, #00E676 100%);
        box-shadow: 0 6px 20px rgba(0, 200, 83, 0.6);
        transform: translateY(-2px);
    }
    
    /* Show shorter text on mobile for Start Earning */
    .streams-tab.start-earning-btn .tab-text-long {
        display: none;
    }
    
    .streams-tab.start-earning-btn .tab-text-short {
        display: inline !important;
    }
    
    /* Mobile-specific optimizations for Start Earning modal */
    #startEarningModal .modal-header {
        padding: 1rem 1.5rem;
        background: linear-gradient(135deg, #1a1a1a 0%, #000000 50%, #1a1a1a 100%);
    }
    
    #startEarningModal .modal-title {
        font-size: 1.6rem; /* Reduced from 1.8rem for better mobile fit */
        padding: 0 1rem;
        line-height: 1.3; /* Better line spacing */
    }
    
    #startEarningModal .modal-body {
        padding: 1.5rem 1rem;
    }
    
    /* Ensure all text in Start Earning modal is white on black */
    #startEarningModal .modal-content {
        background: #000000 !important;
        color: white !important;
    }
    
    /* Mobile Slides Adjustments */
    .slides-container {
        height: 400px; /* Reduced height for mobile */
        margin: 1rem auto;
    }
    
    .slide {
        padding: 1.5rem 1rem; /* Reduced padding for mobile */
    }
    
    .slide h3 {
        font-size: 1.5rem !important; /* Smaller headings on mobile */
        margin-bottom: 1.5rem !important;
    }
    
    .slide p {
        font-size: 1rem !important; /* Smaller text on mobile */
    }
    
    /* Mobile Navigation Buttons - Smaller, more transparent, hidden by default */
    .slide-nav-btn {
        width: 35px; /* Reduced from 40px */
        height: 35px; /* Reduced from 40px */
        font-size: 0.9rem; /* Reduced from 1rem */
        opacity: 0;
        transition: opacity 0.2s ease; /* Faster transition */
        pointer-events: none;
        background: linear-gradient(135deg, rgba(0, 200, 83, 0.4), rgba(0, 200, 83, 0.5)); /* More transparent */
        border: 1px solid rgba(0, 200, 83, 0.6); /* More transparent border */
    }
    
    /* Show navigation buttons when modal body is touched/active - more transparent when visible */
    #startEarningModal .modal-body.touch-active .slide-nav-btn {
        opacity: 0.7; /* Reduced from 1 - more transparent even when visible */
        pointer-events: auto;
    }
    
    /* Hover state for when buttons are visible */
    #startEarningModal .modal-body.touch-active .slide-nav-btn:hover {
        opacity: 0.9; /* Slightly more opaque on hover */
        background: linear-gradient(135deg, rgba(0, 200, 83, 0.6), rgba(0, 200, 83, 0.7));
        transform: translateY(-50%) scale(1.05); /* Smaller scale increase */
    }
    
    .prev-btn {
        left: 1rem; /* Closer to edge on mobile */
    }
    
    .next-btn {
        right: 1rem; /* Closer to edge on mobile */
    }
    
    /* Mobile Indicators */
    .slide-indicators {
        bottom: 1rem; /* Closer to bottom on mobile */
    }
    
    .indicator {
        width: 10px;
        height: 10px; /* Slightly smaller indicators */
    }
}
