/* =========================================
   GLOBAL & CORE STYLES
   ========================================= */
body {
    background-color: #0c0c0c;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

/* =========================================
   STOCK SECTION & HEADER
   ========================================= */
.stock-section {
    padding: 0 10px;
    position: relative;
    margin-bottom: 40px;
}

.stock-premium-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #1e1e1e 0%, #161616 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid #00f2ff;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.stock-premium-title {
    margin: 0;
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stock-count-badge {
    font-size: 0.75rem;
    background: rgba(0, 242, 255, 0.1);
    color: #00f2ff;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0, 242, 255, 0.2);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stock-see-all-btn {
    text-decoration: none;
    color: #b0b0b0;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    padding: 6px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stock-see-all-btn:hover {
    background: #fff;
    color: #000;
    transform: translateX(5px);
}

/* =========================================
   THE CARD STYLES
   ========================================= */

/* 1. Base Card Structure (Shared) */
.stock-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #161616;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}

/* 2. IMAGE ZOOM (Always Slow & Smooth) */
.stock-thumb-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    /* Standard 16:9 ratio */
    overflow: hidden;
    display: block;
}

.stock-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fill the 16:9 area */
    transition: transform 0.6s ease;
    /* SLOW ZOOM everywhere */
    filter: brightness(0.9);
}

.stock-card:hover .stock-thumb {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* =========================================
   BEHAVIOR 1: HOME PAGE SLIDER (Fast Pop + White)
   ========================================= */
.stock-scroll-container .stock-card {
    min-width: 260px;
    width: 260px;
    scroll-snap-align: start;

    /* SPEED CONTROL:
       0.1s = Super Fast (Instant Pop)
       0.2s = Fast
       0.3s = Smooth/Normal
    */
    transition: transform 0.1s ease-out, border-color 0.1s ease;
}

.stock-scroll-container .stock-card:hover {
    transform: translateY(-5px);

    /* CHANGE 1: BACK TO WHITE (Was #00f2ff) */
    border-color: #ffffff;

    /* OPTIONAL: Keep the glow blue? Or White? 
       This makes the glow White too: */
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

/* Title turns White on Home */
.stock-scroll-container .stock-card:hover .stock-name {
    color: #ffffff;
}

/* =========================================
   BEHAVIOR 2: SEE ALL / GRID (Slow Move + Dark Grey)
   ========================================= */
.row .stock-card,
.col-12 .stock-card,
.grid-item .stock-card {
    width: 100%;

    /* SLOW MOVE (0.4s) - Smooth, not snappy */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.row .stock-card:hover,
.col-12 .stock-card:hover {
    transform: translateY(-5px);
    /* Gentle Lift */
    border-color: rgba(255, 255, 255, 0.3);
    /* DARK GREY Border */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    /* Dark Shadow (No Neon) */
}

/* Title stays Light Grey on Grid */
.row .stock-card:hover .stock-name,
.col-12 .stock-card:hover .stock-name {
    color: #e0e0e0;
}

/* =========================================
   INFO & BADGES (Shared)
   ========================================= */
.stock-badge-4k {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #00f2ff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 242, 255, 0.3);
    z-index: 5;
}

.stock-badge-ratio {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #ffbf00;
    /* Amber/Gold */
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 191, 0, 0.3);
    z-index: 5;
    pointer-events: none;
}

.stock-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #1a1a1a;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-grow: 1;
}

.stock-name {
    color: #cccccc;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.stock-meta {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

/* =========================================
   SCROLL CONTAINER & BUTTONS
   ========================================= */
.stock-wrapper {
    position: relative;
}

.stock-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.stock-scroll-container::-webkit-scrollbar {
    display: none;
}

.stock-nav-btn {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.stock-wrapper:hover .stock-nav-btn {
    opacity: 1;
}

.stock-nav-btn:hover {
    background: #00f2ff;
    color: #000;
    border-color: #00f2ff;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.6);
}

.btn-left {
    left: 10px;
}

.btn-right {
    right: 10px;
}

/* =========================================
   FOOTER LINKS
   ========================================= */
.footer-link {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.footer-link:hover {
    color: #00f2ff;
    padding-left: 5px;
}

.social-btn-footer {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    transition: all 0.3s ease;
}

.social-btn-footer:hover {
    background: #fff;
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* =========================================
   LOAD MORE BUTTON (Clean & Professional)
   ========================================= */
#infinite-loading {
    display: table;
    margin: 40px auto;
    /* Centered */
    padding: 10px 25px;
    /* Reduced size (Shorter length) */
    text-decoration: none;

    /* Default Look: Subtle Grey */
    background: transparent;
    color: #b0b0b0;
    /* Light Grey Text */
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;

    /* Subtle Border */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Hover Look: Pure White (No Glow) */
#infinite-loading:hover {
    background: #ffffff;
    /* White Background */
    color: #000000;
    /* Black Text */
    border-color: #ffffff;
    transform: translateY(-2px);
    /* Slight Lift */
    box-shadow: none;
    /* NO GLOW - Clean Look */
}

/* =========================================
   MOBILE RESPONSIVENESS (Media Queries)
   ========================================= */

@media (max-width: 768px) {

    /* Global Spacing */
    .stock-section {
        padding: 0 5px;
        margin-bottom: 25px;
    }

    /* Premium Header Optimization */
    .stock-premium-header {
        padding: 10px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .stock-premium-title {
        font-size: 1rem;
        width: 100%;
        justify-content: space-between;
    }

    .stock-see-all-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.8rem;
    }

    /* Visual Decoder/AI Tool Stacking */
    .ai-hero-card {
        padding: 20px 15px !important;
    }

    .ai-hero-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .ai-hero-icon-container {
        margin: 0 auto;
    }

    .ai-hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .ai-hero-btn {
        width: 100% !important;
        justify-content: center;
    }

    /* Scroll Container Tweaks */
    .stock-scroll-container {
        gap: 10px;
    }

    .stock-scroll-container .stock-card {
        min-width: 200px;
        /* Slightly smaller cards for mobile scroll */
        width: 200px;
    }

    /* Post Page Improvements */
    .post-main-card {
        padding: 15px !important;
    }

    .post-title {
        font-size: 1.25rem !important;
    }

    .post-actions {
        flex-direction: column;
        gap: 10px;
    }

    .post-btn-primary {
        width: 100%;
        justify-content: center;
    }

    /* Navigation Arrows (Make Visible on Mobile) */
    .stock-nav-btn {
        display: flex !important;
        opacity: 0.8 !important;
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    /* Post Image Fluid Height */
    .post-image-container {
        height: auto !important;
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .stock-scroll-container .stock-card {
        min-width: 170px;
        width: 170px;
    }

    .stock-name {
        font-size: 0.85rem;
    }

    .post-image-container {
        min-height: 250px;
    }

    /* Force Stack Download Bar with ID */
    #mobile-download-bar {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        padding: 20px 15px !important;
        display: flex !important;
    }

    #download-btn-group {
        width: 100% !important;
        height: auto !important;
    }

    #download-btn-group .btn:first-child {
        flex: 1 1 auto !important;
        height: 52px !important;
    }

    #download-btn-group .dropdown-toggle-split {
        flex: 0 0 52px !important;
        width: 52px !important;
        height: 52px !important;
    }

    /* Fixed Dropdown Menu for Mobile - Force End Alignment */
    #download-btn-group .dropdown-menu-end {
        right: 0 !important;
        left: auto !important;
        min-width: 240px;
    }

    /* Force AI Hero Buttons stacking with ID */
    #ai-hero-btn-container {
        flex-direction: column !important;
        gap: 12px !important;
        display: flex !important;
    }

    #ai-hero-btn-container .btn {
        width: 100% !important;
    }
}

/* =========================================
   DROPDOWN FIX — Force floating solid overlay on mobile
   ========================================= */
#download-btn-group .dropdown-menu {
    position: absolute !important;
    background-color: #1a1a2e !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    z-index: 9999 !important;
}

#download-btn-group .dropdown-menu .dropdown-item {
    color: #e0e0e0 !important;
}

#download-btn-group .dropdown-menu .dropdown-item:hover,
#download-btn-group .dropdown-menu .dropdown-item:focus {
    background-color: rgba(255, 183, 94, 0.15) !important;
    color: #FFB75E !important;
}

#download-btn-group .dropdown-menu .dropdown-header {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 11px !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

/* =========================================
   IMAGE PROTECTION
   ========================================= */
img,
.card-overlay,
.hover-overlay,
.image-stage,
.post-image-container,
.stock-thumb-wrapper,
.image-wrapper {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
}

/* =========================================
   SEARCH PAGE FILTER SIDEBAR
   ========================================= */
.sidebar-filters {
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    padding-right: 10px;
    /* Space for scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 242, 255, 0.5) rgba(255, 255, 255, 0.05);
}

/* Custom Scrollbar for Filters (Webkit) */
.sidebar-filters::-webkit-scrollbar {
    width: 6px;
}

.sidebar-filters::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.sidebar-filters::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar-filters::-webkit-scrollbar-thumb:hover {
    background: #00f2ff;
}