
:root {
    --primary: #ff6b35;
    --primary-dark: #e85a2a;
    --secondary: #004e89;
    --text: #1a1a2e;
    --text-light: #666666;
    --bg: #ffffff;
    --bg-light: #f8f9fa;
    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    --dark-bg: #222222;
    --dark-bg-light: #333333;
    --dark-text: #f0f0f0;
    --dark-text-light: #999999;
    --dark-border: #444444;
    --dark-shadow: rgba(0, 0, 0, 0.3);
}

html.dark {
    --primary: #ff7a45;
    --primary-dark: #ff6b35;
    --secondary: #007bff;
    --text: #f0f0f0;
    --text-light: #aaaaaa;
    --bg: #1a1a2e;
    --bg-light: #2a2a4a;
    --border: #3a3a5a;
    --shadow: rgba(0, 0, 0, 0.25);
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-light);
    padding-top: 60px;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
}

/* Page-specific styles for index.php */

        /* Hero Section */
        .hero {
            background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
            color: #ffffff;
            /* Keep white text */
            padding: 2rem 1rem;
            text-align: center;
            display: none;
        }

        .hero h1 {
            font-size: 1.5rem;
            margin-bottom: 1rem;
            font-weight: 800;
        }

        .hero p {
            font-size: 1rem;
            opacity: 0.95;
            max-width: 600px;
            margin: 0 auto;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding-top: 0px;
            padding-bottom: 2rem;
            padding-left: 2rem;
            padding-right: 2rem;
        }

        /* NEW: Breadcrumbs */
        .breadcrumbs {
            background: var(--bg);
            /* USE VAR */
            padding: 0.8rem 1.2rem;
            margin-bottom: 1.5rem;
            font-size: 0.9em;
            color: var(--text-light);
            /* USE VAR */
            border-radius: 12px;
            box-shadow: 0 2px 8px var(--shadow);
            /* USE VAR */
            display: inline-block;
        }

        .breadcrumbs a {
            color: var(--primary);
            text-decoration: none;
            font-weight: 500;
        }

        .breadcrumbs a:hover {
            text-decoration: underline;
        }

        .breadcrumbs span.separator {
            margin: 0 0.5em;
            color: var(--text-light);
        }

        /* END: Breadcrumbs */

        .theme-page-subtitle {
            font-size: 1.75rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            color: var(--text);
            line-height: 1.3;
        }

        /* Deep Search UI */
        .deep-search-container {
            background: var(--bg-light);
            /* USE VAR */
            border: 1px solid var(--border);
            /* USE VAR */
            padding: 1.5rem;
            border-radius: 12px;
            margin-bottom: 2rem;
        }

        .deep-search-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .deep-search-header h3 {
            margin: 0;
            font-size: 1.1rem;
        }

        .deep-search-controls {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }

        .deep-search-controls button {
            padding: 0.5rem 1rem;
            background: var(--secondary);
            /* USE VAR */
            color: white;
            border: none;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
        }

        .deep-search-controls button:disabled {
            background: #999;
            cursor: not-allowed;
        }

        /* NEW: Sort Buttons */
        .sort-controls {
            display: flex;
            background: #f8f9fa;
            /* Fallback */
            background: var(--bg, #f8f9fa);
            border: 1px solid #dee2e6;
            /* Fallback */
            border: 1px solid var(--border, #dee2e6);
            border-radius: 8px;
            overflow: hidden;
            margin-right: 1rem;
        }

        .sort-controls .sort-btn {
            background: transparent !important;
            /* Override generic button style */
            border: none;
            padding: 0.5rem 1rem;
            cursor: pointer;
            font-size: 0.9rem;
            color: #6c757d;
            /* Fallback */
            color: var(--text-light, #6c757d);
            transition: all 0.2s;
            border-right: 1px solid #dee2e6;
            border-right: 1px solid var(--border, #dee2e6);
            border-radius: 0 !important;
            /* Reset generic radius */
        }

        .sort-controls .sort-btn:last-child {
            border-right: none;
        }

        .sort-controls .sort-btn:hover {
            background: #e9ecef !important;
            background: var(--bg-light, #e9ecef) !important;
            color: #212529;
            color: var(--text, #212529);
        }

        .sort-controls .sort-btn.active {
            background: #007bff !important;
            /* Fallback blue */
            background: var(--primary, #007bff) !important;
            color: white !important;
            font-weight: 600;
        }

        #deep-search-progress-area {
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border);
            /* USE VAR */
        }

        #deep-search-status {
            font-size: 0.9rem;
            color: var(--text-light);
            margin-bottom: 1rem;
        }

        #live-results-container h4 {
            margin-bottom: 1rem;
        }

        /* The live results will use the main .theme-grid styles */
        #live-results-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
            gap: 1.5rem;
        }

        /* REDESIGNED: Native Listing Tabs */
        .listing-tabs {
            display: flex;
            flex-direction: column;
            background: var(--bg);
            border-radius: 10px;
            margin-bottom: 2rem;
            margin-top: 1rem;
            border: 1px solid var(--border);
            overflow: hidden;
            box-shadow: 0 2px 8px var(--shadow);
        }

        .listing-tabs-group {
            display: flex;
            align-items: center;
            padding: 0 1rem;
            border-bottom: 1px solid var(--border);
            gap: 1.25rem;
            flex-wrap: wrap;
        }

        .listing-tabs-group:last-child {
            border-bottom: none;
        }

        .listing-tabs a {
            padding: 0.75rem 0;
            text-decoration: none;
            font-weight: 600;
            color: var(--text-light);
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            position: relative;
            transition: color 0.2s;
        }

        .listing-tabs a:hover {
            color: var(--text);
        }

        .listing-tabs a.active {
            color: var(--primary);
        }



        .listing-tabs-divider {
            width: 1px;
            height: 18px;
            background: var(--border);
            margin: 0 0.5rem;
        }

        /* Mobile adjustments for listing-tabs */
        @media (max-width: 768px) {
            .listing-tabs-group {
                gap: 0.8rem;
                padding: 0 0.8rem;
            }

            .listing-tabs a {
                padding: 0.6rem 0;
                font-size: 0.85rem;
            }
        }

        /* Theme Grid */
        .theme-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 1.5rem;
            align-items: start;
            /* Allow cards to have different heights */
        }

        .theme-card {
            background: var(--bg);
            /* USE VAR */
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 4px 15px var(--shadow);
            /* USE VAR */
            transition: transform 0.3s, box-shadow 0.3s;
            cursor: pointer;
            text-decoration: none;
            color: var(--text);
            display: block;
            position: relative;
        }

        .theme-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        }

        .theme-card-image {
            width: 100%;
            height: auto;
            display: block;
            background: transparent;
            transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
        }

        .theme-card:hover .theme-card-image {
            transform: scale(1.05);
        }

        .theme-card-content {
            padding: 1.25rem;
        }

        .theme-card h3 {
            font-size: 1rem;
            margin-bottom: 0.5rem;
            font-weight: 700;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            height: 2.5em;
            /* 1.05rem * 1.2 line-height * 2 lines */
        }

        /* Theme card metadata (designer and file size) */
        .theme-card-meta {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            margin-top: 1rem;
            font-size: 0.875rem;
            color: var(--text-light);
            gap: 5px;
        }

        .designer {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1 1 auto;
            margin-right: 10px;
            min-width: 100px;
        }

        .filesize {
            flex-shrink: 0;
        }

        /* Paid Theme Star Badge */
        .paid-badge {
            color: #ffd700;
            font-size: 0.9em;
            margin-left: 4px;
            display: inline-block;
        }


        /* Favourite Button */
        .theme-card-container {
            position: relative;
            display: block;
        }

        .fav-btn {
            position: absolute;
            top: 10px;
            right: 10px;
            background: rgba(255, 255, 255, 0.8);
            border: none;
            border-radius: 50%;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
            transition: transform 0.2s, background 0.2s;
            z-index: 10;
        }

        .fav-btn:hover {
            transform: scale(1.1);
            background: rgba(255, 255, 255, 1);
        }

        .fav-btn svg {
            width: 20px;
            height: 20px;
            stroke: #ff4757;
            transition: fill 0.2s;
        }

        .fav-btn.active svg {
            fill: #ff4757;
        }

        /* In-feed Ad Card Styles */
        .ad-grid-card {
            display: flex;
            align-items: stretch;
            min-height: 380px;
        }

        .ad-card-inner {
            width: 100%;
            display: flex;
            flex-direction: column;
            background: var(--bg-light);
            border: 1px dashed var(--border);
            border-radius: 16px;
            padding: 0.75rem;
            position: relative;
            box-shadow: 0 4px 15px var(--shadow);
        }

        .ad-card-label {
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-light);
            margin-bottom: 0.5rem;
            text-align: right;
            display: block;
        }

        .ad-card-body {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 280px;
        }

        .detail-fav-btn {
            position: relative;
            top: auto;
            right: auto;
            width: auto;
            height: auto;
            padding: 1rem 2rem;
            border-radius: 50px;
            background: var(--bg-light);
            border: 1px solid var(--border);
            color: var(--text);
            box-shadow: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            flex-grow: 1;
            flex-basis: 200px;
            font-size: 1.1rem;
            font-weight: 700;
            transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
            cursor: pointer;
        }

        .detail-fav-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px var(--shadow);
            background: var(--bg);
        }

        /* END FIXED CSS */

        /* Detail Page */
        .detail-container {
            max-width: 1200px;
            margin: 2rem auto;
            padding: 2rem;
        }

        .detail-grid {
            display: grid;
            grid-template-columns: 0.66fr 1fr;
            /* <-- This is the change (approx 40% / 60% split) */
            gap: 3rem;
            background: var(--bg);
            /* USE VAR */
            padding: 3rem;
            border-radius: 20px;
            box-shadow: 0 8px 30px var(--shadow);
            /* USE VAR */

            /* THIS IS THE FIX: Aligns columns to the top */
            align-items: start;
        }

        .carousel-container {
            position: relative;
            border-radius: 16px;
            overflow: hidden;
            background: var(--bg-light);
            /* USE VAR */

            /* NEW: This makes the container stick to the top */
            position: sticky;
            top: 80px;
            /* 60px header + 20px space */
        }

        .carousel {
            display: flex;
            transition: transform 0.5s ease;
        }

        .carousel-image {
            width: 100%;
            flex-shrink: 0;
            aspect-ratio: 9/16;
            object-fit: contain;
            cursor: pointer;
            /* NEW: Add pointer for lightbox */
        }

        .carousel-btn {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(255, 255, 255, 0.9);
            border: none;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 10px var(--shadow);
            /* USE VAR */
            transition: background 0.3s;
            z-index: 10;
        }

        .carousel-btn:hover {
            background: #ffffff;
        }

        .carousel-btn.prev {
            left: 0.1rem;
        }

        .carousel-btn.next {
            right: 0.1rem;
        }

        .carousel-dots {
            position: absolute;
            bottom: 1rem;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 0.5rem;
            z-index: 10;
        }

        .carousel-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.5);
            cursor: pointer;
            transition: background 0.3s;
        }

        .carousel-dot.active {
            background: #ffffff;
        }

        .detail-info h1 {
            font-size: 2.5rem;
            margin-bottom: 1rem;
            font-weight: 800;
        }

        .detail-meta {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
            gap: 1.5rem 1rem;
            margin: 1.5rem 0;
            padding: 1.5rem;
            background: var(--bg-light);
            /* USE VAR */
            border-radius: 12px;
            border: 1px solid var(--border);
        }

        .meta-item {
            display: flex;
            flex-direction: column;
        }

        .meta-label {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-light);
            margin-bottom: 0.35rem;
            font-weight: 600;
        }

        .meta-value {
            font-weight: 700;
            font-size: 1.1rem;
        }

        /* NEW: Styles for clickable tags */
        .meta-value a {
            color: var(--primary);
            text-decoration: none;
            font-weight: 700;
        }

        .meta-value a:hover {
            text-decoration: underline;
        }

        .meta-value .tag-link {
            display: inline-block;
            background: var(--border);
            /* USE VAR */
            color: var(--text-light);
            /* USE VAR */
            padding: 0.2rem 0.6rem;
            border-radius: 6px;
            font-size: 0.9em;
            font-weight: 600;
            margin: 2px;
            transition: background 0.3s;
        }

        .meta-value .tag-link:hover {
            background: var(--primary);
            /* USE VAR */
            color: #ffffff;
            text-decoration: none;
        }

        /* END: Styles for clickable tags */

        /* --- NEW: Notes & Description Sections --- */
        .notes-section,
        .description {
            margin: 2rem 0;
            padding: 1.5rem;
            background: var(--bg-light);
            border-radius: 12px;
            border: 1px solid var(--border);
        }

        .notes-section h3,
        .description h3 {
            font-size: 1.4rem;
            font-weight: 800;
            margin-bottom: 1rem;
            padding-bottom: 0.5rem;
            padding-left: 0.75rem;
            border-left: 4px solid var(--primary);
            border-bottom: 1px solid var(--border);
            color: var(--text);
        }

        .custom-description {
            font-size: 1.1em;
            line-height: 1.8;
            color: var(--text);
            /* Make it stand out */
            word-wrap: break-word;
            overflow-wrap: break-word;
        }

        .description p {
            line-height: 1.8;
            color: var(--text-light);
            word-wrap: break-word;
            overflow-wrap: break-word;
        }

        .description a,
        .custom-description a {
            word-break: break-all;
            overflow-wrap: anywhere;
        }

        /* NEW: Update Log Styles */
        .update-logs {
            margin: 2rem 0;
            padding: 1.5rem;
            background: var(--bg-light);
            /* USE VAR */
            border-radius: 12px;
            border: 1px solid var(--border);
        }

        .update-logs h3 {
            margin-bottom: 1rem;
        }

        .more-logs-details {
            margin-top: 1rem;
            border-top: 1px dashed var(--border);
            padding-top: 1rem;
        }

        .more-logs-details summary {
            cursor: pointer;
            list-style: none;
            /* Hide default arrow */
            font-weight: 600;
            color: var(--primary);
            outline: none;
            display: inline-block;
        }

        .more-logs-details summary::-webkit-details-marker {
            display: none;
        }

        .more-logs-details[open] summary {
            margin-bottom: 1rem;
        }

        .update-logs ul {
            list-style-type: none;
            /* Remove default bullets */
            padding-left: 0.5rem;
        }

        .update-logs li {
            margin-bottom: 0.75rem;
            color: var(--text-light);
        }

        .update-logs li strong {
            color: var(--text);
            display: block;
            /* Make version number its own line */
            font-size: 1.05em;
        }

        .update-logs li ul {
            list-style-type: disc;
            /* Use bullets for nested items */
            padding-left: 20px;
            /* Indent nested items */
        }

        .update-logs li li {
            margin-bottom: 0.25rem;
        }

        /* END: Update Log Styles */

        .download-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 1rem 3rem;
            background: var(--primary);
            /* USE VAR */
            color: white;
            text-decoration: none;
            border-radius: 50px;
            font-weight: 700;
            font-size: 1.1rem;
            transition: background 0.3s, transform 0.2s;
            box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
        }

        .download-btn:hover {
            background: var(--primary-dark);
            transform: translateY(-2px);
        }

        /* NEW Button Styles */
        .button-container {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
            margin-top: 2rem;
            position: relative;
            z-index: 10;
        }

        .button-container .download-btn {
            flex-grow: 1;
            flex-basis: 200px;
            /* Each button will try to be at least 200px */
            text-align: center;
            padding: 1rem 2rem;
            /* Adjust padding slightly for flex */
        }

        .download-btn.secondary {
            background: var(--secondary);
            /* USE VAR */
            box-shadow: 0 4px 15px rgba(0, 78, 137, 0.3);
        }

        .download-btn.secondary:hover {
            background: #003a6c;
            /* A darker shade of secondary */
            transform: translateY(-2px);
        }

        /* NEW Green Button Style */
        .download-btn.green {
            background: #28a745;
            box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
        }

        .download-btn.green:hover {
            background: #218838;
            transform: translateY(-2px);
        }

        /* END NEW Button Styles */

        /* NEW: Share Buttons */
        .share-container {
            margin-top: 2.5rem;
        }

        .share-container h3 {
            font-size: 1.1rem;
            color: var(--text-light);
            margin-bottom: 1rem;
            text-align: center;
        }

        .share-options-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            justify-content: center;
            width: 100%;
        }

        .share-btn.social-link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.6rem 1.2rem;
            border-radius: 50px;
            text-decoration: none;
            color: #fff;
            font-weight: 600;
            font-size: 0.9rem;
            border: none;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .share-btn.social-link:hover {
            transform: translateY(-2px);
            opacity: 0.9;
        }

        .share-btn.social-link.modern-share {
            background: linear-gradient(135deg, var(--primary) 0%, #ff8c42 100%);
            box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
        }

        .share-btn.social-link.modern-share svg {
            margin-right: 6px;
        }

        .share-btn.social-link.facebook {
            background: #1877F2;
        }

        .share-btn.social-link.twitter {
            background: #1DA1F2;
        }

        .share-btn.social-link.whatsapp {
            background: #25D366;
        }

        .share-btn.social-link.pinterest {
            background: #E60023;
        }

        .share-btn.social-link.telegram {
            background: #0088cc;
        }

        .share-btn.social-link.copy-link {
            background: #767676;
        }

        /* Pagination */
        .pagination {
            display: flex;
            justify-content: center;
            gap: 0.5rem;
            margin-top: 3rem;
            flex-wrap: wrap;
        }

        .pagination a,
        .pagination span {
            padding: 0.75rem 1.25rem;
            background: var(--bg);
            /* USE VAR */
            border-radius: 8px;
            text-decoration: none;
            color: var(--text);
            /* USE VAR */
            font-weight: 600;
            transition: background 0.3s;
        }

        .pagination a:hover {
            background: var(--primary);
            /* USE VAR */
            color: white;
        }

        .pagination .active {
            background: var(--primary);
            /* USE VAR */
            color: white;
        }

        /* Page-specific responsive styles */

        @media (max-width: 1050px) {
            .detail-grid {
                grid-template-columns: 1fr;
                gap: 2.5rem;
                padding: 2.5rem;
            }

            .carousel-container {
                position: relative;
                top: 0;
                /* Un-stick on tablet/mobile */
                width: 60%;
                margin: 0 auto;
                border-radius: 16px;
                padding-left: 0.5rem;
                padding-right: 0.5rem;
            }

            .detail-container {
                padding: 1rem;
            }
        }

        @media (max-width: 768px) {
            .hero h1 {
                font-size: 2rem;
            }

            .detail-grid {
                gap: 2rem;
                padding: 1.5rem;
            }

            .carousel-container {
                width: 80%;
                /* Expand width on mobile screen widths */
            }

            .detail-info h1 {
                font-size: 2rem;
            }

            .theme-grid {
                grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
            }

            .deep-search-header {
                flex-direction: column;
                align-items: flex-start;
            }

            /* This is now smaller than the main grid */
            #live-results-list {
                grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            }

            /* NEW: Make carousel take full width on mobile */
            .detail-container {
                padding: 0.5rem;
            }

            .theme-page-subtitle {
                font-size: 1.4rem;
                padding: 0 1.5rem;
                /* Match detail-grid padding */
                text-align: center;
            }
        }

        @media (max-width: 480px) {
            .carousel-container {
                width: 90%;
                /* Take full layout on tiny mobile screens */
            }

            /* This is the main grid */
            .theme-grid {
                grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
            }

            .theme-card-content {
                padding: 1rem;
            }

            .theme-card h3 {
                font-size: 0.95rem;
            }

            /* This is the smaller live-results grid */
            #live-results-list {
                grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            }

            /* We also make the text and padding smaller for live cards */
            #live-results-list .theme-card-content {
                padding: 0.75rem;
            }

            #live-results-list .theme-card h3 {
                font-size: 0.85rem;
            }

            #live-results-list .theme-card-meta {
                font-size: 0.75rem;
            }

            /* NEW: Make carousel take full width on mobile */
            .detail-container {
                padding: 1rem;
                width: 100%;
                box-sizing: border-box;
            }

            .detail-grid {
                padding: 0;
                border-radius: 0;
                box-shadow: none;
                width: 100%;
                box-sizing: border-box;
            }

            .detail-info {
                padding: 1rem 0;
                width: 100%;
                box-sizing: border-box;
                min-width: 0;
                /* Critical: Allows flex/grid children to shrink below content width */
                overflow-wrap: anywhere;
                /* Fallback for blowout */
            }
        }

        /* --- NEW Lightbox Loader --- */
        .lightbox-loader {
            width: 50px;
            height: 50px;
            border: 5px solid rgba(255, 255, 255, 0.2);
            border-top-color: #fff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            position: absolute;
            top: 50%;
            left: 50%;
            margin-top: -25px;
            margin-left: -25px;
            display: none;
            /* Hidden by default */
            z-index: 10000;
        }

        .lightbox-loader.active {
            display: block;
        }

        .lightbox-image {
            /* This ensures the image is hidden *during* load */
            display: none;
        }

        .lightbox-image.loaded {
            /* When loaded, it becomes visible */
            display: block;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        /* --- NEW Lightbox Animations --- */
        @keyframes slideInFromRight {
            from {
                transform: translateX(50px);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes slideInFromLeft {
            from {
                transform: translateX(-50px);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        .lightbox-image.animate-next {
            animation: slideInFromRight 0.3s ease-out;
        }

        .lightbox-image.animate-prev {
            animation: slideInFromLeft 0.3s ease-out;
        }

        /* --- NEW: How-To Section --- */
        .how-to-section {
            background: var(--bg);
            /* USE VAR */
            border-radius: 20px;
            padding: 2rem;
            margin-top: 2.5rem;
            box-shadow: 0 8px 30px var(--shadow);
            /* USE VAR */
        }

        .how-to-section details {
            background: var(--bg-light);
            /* USE VAR */
            border-radius: 8px;
            margin-bottom: 1rem;
            border: 1px solid var(--border);
            /* USE VAR */
        }

        .how-to-section summary {
            padding: 1rem 1.5rem;
            font-weight: 600;
            font-size: 1.1rem;
            cursor: pointer;
            list-style: none;
            /* Remove default marker */
            position: relative;
        }

        .how-to-section summary::-webkit-details-marker {
            display: none;
            /* Hide for WebKit */
        }

        .how-to-section summary::after {
            content: '+';
            font-size: 1.5rem;
            color: var(--primary);
            position: absolute;
            right: 1.5rem;
            top: 50%;
            transform: translateY(-50%);
            transition: transform 0.2s;
        }

        .how-to-section details[open] summary::after {
            transform: translateY(-50%) rotate(45deg);
        }

        .how-to-section details>div {
            padding: 0 1.5rem 1.5rem 1.5rem;
            border-top: 1px solid var(--border);
            /* USE VAR */
            line-height: 1.7;
        }

        .how-to-section details li {
            margin-bottom: 0.75rem;
            margin-left: 1.5rem;
            /* Indent list items */
        }

        .how-to-section details a {
            color: var(--primary);
            font-weight: 600;
            text-decoration: none;
        }

        .how-to-section details a:hover {
            text-decoration: underline;
        }

        /* Alternative Search Button */
        #toggle-local-search-btn {
            background: transparent;
            border: 2px solid var(--primary);
            color: var(--primary);
            padding: 0.8rem 1.5rem;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s ease;
            margin-top: 1rem;
        }

        #toggle-local-search-btn:hover {
            background: var(--primary);
            color: #ffffff;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        /* Responsive Listing Tabs */
        .listing-tabs {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 1rem;
            margin-bottom: 2rem;
            background: var(--bg-light);
            /* USE VAR */
            padding: 0.75rem;
            border-radius: 12px;
            border: 1px solid var(--border);
            /* USE VAR */
        }

        .listing-tabs-group {
            display: inline-flex;
            gap: 0.5rem;
            align-items: center;
        }

        .listing-tabs a {
            padding: 0.5rem 1rem;
            border-radius: 8px;
            text-decoration: none;
            color: var(--text-light);
            /* USE VAR */
            font-weight: 500;
            transition: all 0.2s;
        }

        .listing-tabs a:hover {
            background: rgba(0, 0, 0, 0.05);
            color: var(--text);
            /* USE VAR */
        }

        .listing-tabs a.active {
            background: var(--primary);
            /* USE VAR */
            color: white;
            box-shadow: 0 2px 8px var(--shadow);
            /* USE VAR */
        }

        .listing-tabs-divider {
            height: 24px;
            width: 2px;
            /* Thicker divider */
            background: var(--border);
            /* USE VAR */
            margin: 0 1rem;
            /* More space */
            opacity: 0.7;
        }

        /* Mobile Responsiveness */
        @media (max-width: 600px) {
            .listing-tabs {
                flex-direction: column;
                /* Stack groups */
                align-items: stretch;
                /* Full width */
                gap: 1rem;
                padding: 1rem;
            }

            .listing-tabs-group {
                display: flex;
                /* Make buttons flex items */
                width: 100%;
                gap: 0.5rem;
            }

            /* Evenly distribute buttons on mobile */
            .listing-tabs-group a {
                flex: 1;
                text-align: center;
                justify-content: center;
            }

            .listing-tabs-divider {
                display: block;
                /* Show divider on mobile */
                width: 100%;
                /* Full width */
                height: 1px;
                /* Horizontal line */
                height: 1px;
                margin: 0.5rem 0;
            }

            .listing-tabs a {
                white-space: nowrap;
                font-size: 0.95rem;
                padding: 0.75rem 0.5rem;
                /* Larger touch target */
            }
        }
    
/* Extracted from header.php */


    /* Header Styles */
    header {
        background: var(--bg);
        box-shadow: 0 2px 10px var(--shadow);
        position: fixed;
        top: 0;
        z-index: 1000;
        width: 100%;
        height: 60px;
        border-bottom: 1px solid var(--border);
    }

    nav {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 2rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        height: 100%;
    }

    .logo {
        font-family: 'Outfit', sans-serif;
        font-size: 1.5rem;
        font-weight: 800;
        color: var(--primary);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .logo svg {
        width: 28px;
        height: 28px;
        color: var(--primary);
    }

    .nav-links {
        display: flex;
        align-items: center;
        gap: 2rem;
        flex-grow: 1;
    }

    .nav-menu {
        display: flex;
        gap: 2rem;
        list-style: none;
        align-items: center;
        flex-shrink: 0;
    }

    .nav-menu a {
        color: var(--text);
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s;
    }

    .nav-menu a:hover {
        color: var(--primary);
    }

    .dropdown {
        position: relative;
    }

    .dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--bg);
        box-shadow: 0 4px 10px var(--shadow);
        border-radius: 8px;
        list-style: none;
        padding: 0.5rem 0;
        min-width: 150px;
        z-index: 1001;
        max-height: 300px;
        overflow-y: auto;
        border: 1px solid var(--border);
    }

    .dropdown:hover .dropdown-menu {
        display: block;
    }

    .dropdown-menu a {
        display: block;
        padding: 0.5rem 1rem;
    }

    .nav-icons {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    .nav-icon-btn {
        background: none;
        border: none;
        cursor: pointer;
        color: var(--text-light);
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        transition: color 0.3s, background-color 0.3s;
    }

    .nav-icon-btn svg {
        width: 22px;
        height: 22px;
    }

    .nav-icon-btn:hover {
        color: var(--primary);
        background-color: var(--bg-light);
    }

    .theme-dropdown {
        position: relative;
    }

    .theme-dropdown-menu {
        display: none;
        position: absolute;
        top: 120%;
        right: 0;
        background: var(--bg);
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        border-radius: 12px;
        list-style: none;
        padding: 0.5rem;
        min-width: 150px;
        z-index: 1002;
        border: 1px solid var(--border);
        transform-origin: top right;
    }

    html.dark .theme-dropdown-menu {
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    .theme-dropdown-menu.active {
        display: block;
        animation: dropDownAnim 0.2s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    }

    @keyframes dropDownAnim {
        from { opacity: 0; transform: scale(0.95); }
        to { opacity: 1; transform: scale(1); }
    }

    .theme-dropdown-menu .theme-option {
        background: none;
        border: none;
        color: var(--text-light);
        padding: 0.75rem 1rem;
        cursor: pointer;
        display: block;
        width: 100%;
        text-align: left;
        border-radius: 8px;
        font-size: 0.95rem;
        font-weight: 500;
        transition: all 0.2s ease;
    }

    .theme-dropdown-menu .theme-option:hover {
        background: var(--bg-light);
        color: var(--primary);
    }

    .moon-icon {
        display: none;
    }

    .sun-icon {
        display: block;
    }

    html.dark .moon-icon {
        display: block;
    }

    html.dark .sun-icon {
        display: none;
    }

    .search-overlay {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--bg);
        z-index: 1001;
        padding: 2rem;
        display: none;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        border-bottom: 1px solid var(--border);
        box-sizing: border-box; /* Fixes right-side clipping */
    }

    html.dark .search-overlay {
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    .search-overlay.active {
        display: block;
        animation: slideDown 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    }

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

    .search-bar {
        display: flex;
        flex-direction: column;
        gap: 1.2rem;
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
        box-sizing: border-box;
    }

    .search-bar input,
    .search-bar .search-server-select {
        padding: 0.85rem 1.25rem;
        border: 1px solid var(--border);
        border-radius: 12px;
        font-size: 1rem;
        background: var(--bg-light);
        color: var(--text);
        width: 100%;
        box-sizing: border-box;
        transition: all 0.3s ease;
    }

    .search-bar input::placeholder {
        color: var(--text-light);
    }

    .search-bar input:focus,
    .search-bar .search-server-select:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
        background: var(--bg);
    }

    .search-bar button {
        padding: 0.85rem 1.5rem;
        background: linear-gradient(135deg, #FF6B00, #FF4500);
        color: white;
        border: none;
        border-radius: 12px;
        font-weight: 700;
        font-size: 1rem;
        cursor: pointer;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
    }

    .search-bar button:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
    }

    .search-overlay-close {
        display: none;
    }

    .hamburger {
        display: none;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--text);
        font-size: 1.8rem;
        line-height: 1;
    }

    /* Responsive Header Styles */
    @media (max-width: 900px) {
        nav {
            flex-wrap: wrap;
        }

        .nav-links {
            order: 4;
            width: 100%;
        }

        .hamburger {
            display: flex;
            order: 3;
        }

        .nav-icons {
            order: 2;
        }

        .nav-menu {
            display: none;
            flex-direction: column;
            width: 100%;
            background: var(--bg);
            position: absolute;
            top: 60px;
            left: 0;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            padding: 1rem 0;
            gap: 0;
            border-top: 1px solid var(--border);
            border-bottom: 1px solid var(--border);
            z-index: 1000;
        }

        html.dark .nav-menu {
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        }

        .nav-menu.active {
            display: flex;
            animation: slideDown 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
        }

        .nav-menu li {
            width: 100%;
        }

        .nav-menu a {
            padding: 1rem 2rem;
            display: block;
            color: var(--text);
            font-weight: 500;
            transition: background 0.2s;
        }

        .nav-menu a:hover {
            color: var(--primary);
            background: var(--bg-light);
        }

        .dropdown-menu {
            position: static;
            box-shadow: none;
            border-radius: 0;
            border-top: 1px solid var(--border);
            min-width: 100%;
            background: var(--bg-light);
        }

        .dropdown:hover .dropdown-menu {
            display: none;
        }

        .dropdown a.active+.dropdown-menu {
            display: block;
            animation: fadeIn 0.3s ease forwards;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
    }


/* Extracted from common-styles.php */
.ads-container {
    padding-top: 10px;
        padding-bottom: 0px;
        padding-left: 1rem;
        padding-right: 1rem;
        background: var(--bg-light);
        border-radius: 16px;
        border: 1px dashed var(--border);
        position: relative;
        overflow: hidden;
    }

    .ads-container::before {
        content: 'Advertisement';
        display: block;
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-light);
        margin-bottom: 0.75rem;
        font-weight: 700;
        font-family: 'Outfit', sans-serif;
    }

    /* In-Feed Grid Ad Card */
    .ad-grid-card {
        display: flex;
        flex-direction: column;
        height: 100%;
        grid-column: span 2;
    }

    .ad-card-inner {
        background: var(--bg-light);
        border: 1px dashed var(--border);
        box-shadow: none !important;
        cursor: default !important;
        transform: none !important;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        min-height: 280px;
        height: 100%;
        padding: 0.75rem;
        border-radius: 16px;
        width: 100%;
        box-sizing: border-box;
    }

    .ad-card-label {
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-light);
        margin-bottom: 0.5rem;
        text-align: center;
        font-weight: 700;
        font-family: 'Outfit', sans-serif;
    }

    .ad-card-body {
        width: 100%;
        flex-grow: 1;
        display: block;
        box-sizing: border-box;
        text-align: center;
    }

    .theme-card {
        position: relative;
        /* Ensure relative positioning for absolute badge */
    }



    .price-badge {
        position: absolute;
        top: 10px;
        left: 10px;
        background: rgba(0, 0, 0, 0.7);
        color: #fff;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.8rem;
        font-weight: 600;
        z-index: 2;
    }

    .price-badge.free {
        background: rgba(40, 167, 69, 0.9);
        /* Green for Free */
    }

    .price-badge.paid {
        background: rgba(255, 193, 7, 0.95);
        /* Yellow/Gold for Paid */
        color: #000;
    }

    /* Google AdSense Responsive & Viewport Constraint */
    ins.adsbygoogle, 
    .adsbygoogle {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Responsive adjustments for header and general layout */
    @media (max-width: 768px) {
        .ad-grid-card {
            grid-column: 1 / -1 !important;
        }
        nav {
            padding: 0 1rem !important;
        }
        .container {
            padding: 0 1rem 2rem 1rem !important;
        }
        .detail-container, .detail-grid {
            padding: 0 !important;
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
        }
    }


/* Extracted from footer.php */


    /* Footer Styles */
    footer {
        background: #1a1a2e;
        color: #f0f0f0;
        padding: 3rem 2rem 1.5rem;
        margin-top: 4rem;
    }

    .footer-content {
        max-width: 1400px;
        margin: 0 auto;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 2rem;
        margin-bottom: 2rem;
    }

    .footer-section h3 {
        margin-bottom: 1rem;
        color: var(--primary);
    }

    .footer-section p,
    .footer-section a {
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        display: block;
        margin-bottom: 0.5rem;
    }

    .footer-section a:hover {
        color: var(--primary);
    }

    .footer-bottom {
        text-align: center;
        padding-top: 2rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.6);
    }

    /* Lightbox Styles */
    .lightbox {
        display: none;
        position: fixed;
        z-index: 9999;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.9);
        cursor: pointer;
        align-items: center;
        justify-content: center;
    }

    .lightbox.active {
        display: flex;
    }

    .lightbox-image {
        max-width: 95%;
        max-height: 90%;
        object-fit: contain;
        cursor: default;
        display: none;
    }

    .lightbox-image.loaded {
        display: block;
    }

    .lightbox-close {
        position: absolute;
        top: 20px;
        right: 30px;
        font-size: 3rem;
        color: #fff;
        text-decoration: none;
        font-weight: bold;
    }

    .lightbox-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(255, 255, 255, 0.2);
        border: none;
        width: 50px;
        height: 70px;
        border-radius: 8px;
        cursor: pointer;
        font-size: 2.5rem;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.3s;
        user-select: none;
    }

    .lightbox-nav:hover {
        background: rgba(255, 255, 255, 0.4);
    }

    .lightbox-nav.prev {
        left: 10px;
    }

    .lightbox-nav.next {
        right: 10px;
    }

    .lightbox-loader {
        width: 50px;
        height: 50px;
        border: 5px solid rgba(255, 255, 255, 0.2);
        border-top-color: #fff;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        position: absolute;
        top: 50%;
        left: 50%;
        margin-top: -25px;
        margin-left: -25px;
        display: none;
        z-index: 10000;
    }

    .lightbox-loader.active {
        display: block;
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    @keyframes slideInFromRight {
        from {
            transform: translateX(50px);
            opacity: 0;
        }

        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes slideInFromLeft {
        from {
            transform: translateX(-50px);
            opacity: 0;
        }

        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    .lightbox-image.animate-next {
        animation: slideInFromRight 0.3s ease-out;
    }

    .lightbox-image.animate-prev {
        animation: slideInFromLeft 0.3s ease-out;
    }

    .cookie-banner {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--bg);
        padding: 1rem 1.5rem;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        display: none;
        /* Hidden by default, shown by JS */
        z-index: 100000;
        max-width: 90%;
        width: 450px;
        border: 1px solid var(--border);
    }

    html.dark .cookie-banner {
        background: var(--dark-bg);
        border-color: var(--dark-border);
    }

    .cookie-content {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .cookie-content p {
        margin: 0;
        font-size: 0.9rem;
        color: var(--text);
        line-height: 1.5;
    }

    .cookie-content a {
        color: var(--primary);
        text-decoration: underline;
    }

    .cookie-btn {
        background: var(--primary);
        color: white;
        border: none;
        padding: 0.6rem 1.5rem;
        border-radius: 50px;
        cursor: pointer;
        font-weight: 600;
        align-self: center;
        transition: background 0.3s;
    }

    .cookie-btn:hover {
        background: var(--primary-dark);
    }

    @media (min-width: 600px) {
        .cookie-content {
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            text-align: left;
        }

        .cookie-btn {
            flex-shrink: 0;
            margin-left: 10px;
        }
    }

/* ==========================================================================
   Static Pages & Download Styles (pages/* & download.php)
   ========================================================================== */

/* Page Container (About, Contact, DMCA, Privacy, Terms) */
.page-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow);
}

.page-container h1 {
    color: var(--text);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 1rem;
}

.page-container h2 {
    color: var(--text);
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
    padding-left: 10px;
}

.page-container p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.page-container ul {
    color: var(--text-light);
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.page-container li {
    margin-bottom: 0.8rem;
}

.disclaimer-box {
    background-color: rgba(255, 0, 0, 0.05);
    border: 1px solid rgba(255, 0, 0, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-top: 3rem;
}

.disclaimer-box h3 {
    color: var(--text);
    margin-top: 0;
    font-size: 1.2rem;
}

.disclaimer-box p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Contact Form Grid */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.contact-info {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 8px;
}

.contact-info h3 {
    color: var(--text);
    margin-bottom: 1rem;
}

.contact-info p {
    margin-bottom: 0.75rem;
}

.contact-form {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.submit-btn {
    background: var(--primary);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: var(--primary-dark);
}

.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Download Page Styles */
.download-container {
    max-width: 800px;
    margin: 2rem auto;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow);
}

.download-container h1 {
    color: var(--text);
    margin-bottom: 1.5rem;
    font-size: 2rem;
    text-align: center;
}

.download-container h2 {
    color: var(--text);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
}

.details-table-wrapper {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.details-table th,
.details-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light, #eee);
}

.details-table tr:last-child th,
.details-table tr:last-child td {
    border-bottom: none;
}

.details-table th {
    font-weight: 600;
    color: var(--text-light, #666);
    width: 30%;
}

.details-table td {
    color: var(--text);
    font-weight: 500;
}

.link-list {
    list-style-type: none;
    padding-left: 0;
}

.link-list li {
    margin-bottom: 1rem;
}

.link-list a {
    display: block;
    padding: 1rem 1.5rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    word-break: break-all;
    transition: all 0.3s;
}

.link-list a:hover {
    background: var(--primary);
    color: white;
    transform: translateX(5px);
}

.link-list .primary a {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.link-list .primary a:hover {
    background: #28a745;
    color: white;
}

.error-box {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.error-box strong {
    display: block;
    margin-bottom: 0.5rem;
}

.download-instructions {
    background: var(--bg-light);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    text-align: center;
}

/* Ranking Page Styles */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.page-header .flag { font-size: 2.5rem; }
.page-header h1 { font-size: 1.9rem; font-weight: 800; }
.page-header p { color: var(--text-light); font-size: 0.95rem; margin-top: 0.2rem; }

.tab-bar {
    display: flex;
    gap: 0.35rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2rem;
}
.tab-btn {
    padding: 0.65rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    color: var(--text-light);
    transform: translateY(2px);
    transition: color 0.2s, border-color 0.2s;
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-btn:hover { color: var(--text); }

.rank-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}
.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; }
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #9a9a9a); color: #000; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #a0522d); color: #fff; }
.card-wrap { position: relative; }

/* Responsive adjustments for static pages */
@media (max-width: 768px) {
    .page-container,
    .download-container {
        margin: 1rem;
        width: auto;
        padding: 1.25rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 1.5rem;
    }

    .contact-info,
    .contact-form {
        padding: 1.25rem;
        width: 100%;
    }
}

.ranking-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.load-more-wrap { text-align: center; margin-top: 2.5rem; }
.load-more-btn {
    background: var(--primary);
    color: #fff;
    padding: 0.7rem 2.5rem;
    border: none;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.load-more-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.load-more-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Skeleton */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}
.skeleton-card {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.skel-img { width: 100%; aspect-ratio: 9/16; background: var(--bg-light); animation: shimmer 1.4s infinite; }
.skel-text { height: 12px; background: var(--bg-light); margin: 10px 12px 6px; border-radius: 6px; animation: shimmer 1.4s infinite; }
.skel-text.short { width: 55%; }
@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.error-state { text-align: center; padding: 3rem 1rem; color: var(--text-light); }
.error-state .emoji { font-size: 3rem; }

/* ==========================================================================
   Error Page Styles (error.php)
   ========================================================================== */
.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 2rem;
    text-align: center;
}

.error-content {
    max-width: 600px;
    background: var(--bg);
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 0 8px 30px var(--shadow);
    border: 1px solid var(--border);
}

.error-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.error-code {
    font-size: 5rem;
    font-weight: 900;
    margin: 0;
    line-height: 1;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Outfit', sans-serif;
}

.error-title {
    font-size: 2rem;
    margin: 1rem 0;
    color: var(--text);
    font-weight: 800;
}

.error-message {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.error-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    cursor: pointer;
}

.error-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
}

.error-btn.secondary {
    background: transparent;
    color: var(--text) !important;
    border: 2px solid var(--border);
    box-shadow: none;
}

.error-btn.secondary:hover {
    background: var(--bg-light);
    border-color: var(--primary);
    color: var(--primary) !important;
    transform: translateY(-3px) scale(1.05);
}

.helpful-links {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.helpful-links h3 {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 600;
}

.helpful-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.helpful-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.helpful-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

@media (max-width: 600px) {
    .error-content {
        padding: 2rem 1.5rem;
    }

    .error-code {
        font-size: 3.5rem;
    }

    .error-title {
        font-size: 1.5rem;
    }

    .error-actions {
        flex-direction: column;
    }

    .error-btn {
        width: 100%;
        justify-content: center;
    }
}


