/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;800&display=swap');

/* Spider-Man Theme Variables */
:root {
    --bg-white: #ffffff;
    --text-black: #111111;
    --spidey-red: #e23636;
    --dark-red: #b32424;
    --grey-light: #f4f4f4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html, body {
    height: 100%; /* Browser ko batana ke poori height use karni hai */
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Minimum screen ki poori height lega */
    margin: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-black);
    font-weight: 800;
}

a {
    color: var(--text-black);
    text-decoration: none;
    transition: 0.3s ease;
}

a:hover {
    color: var(--spidey-red);
}

/* Spider-Man Theme Button */
.btn-primary {
    background-color: var(--spidey-red);
    color: var(--bg-white);
    padding: 10px 24px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--dark-red);
    color: var(--bg-white);
    transform: translateY(-2px); /* Button thoda upar uthega hover pe */
}

/* Navbar Styling */
header {
    background-color: var(--bg-white);
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-black);
    letter-spacing: 1px;
}

.logo span {
    color: var(--spidey-red); /* RIP red hoga, Games black hoga */
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

nav ul li a {
    font-weight: 600;
    font-size: 16px;
}

/* css/home.css */

.trending-section {
    padding: 50px 5%;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 30px;
    border-left: 5px solid var(--spidey-red); /* Red line before heading */
    padding-left: 10px;
}

/* CSS Grid for Games */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* Game Card Style */
.game-card {
    background-color: var(--grey-light);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-10px); /* Hover karne par card upar uthega */
    box-shadow: 0 10px 20px rgba(226, 54, 54, 0.2); /* Spidey Red glow shadow */
}

.game-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.game-info {
    padding: 20px;
}

.game-category {
    font-size: 0.8rem;
    color: var(--spidey-red);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: block;
}

.game-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Bada naam automatically '...' ho jayega */
}

.game-card .btn-primary {
    width: 100%; /* Button card ki full width lega */
    text-align: center;
}

/* --- Search Overlay Styling --- */
.search-overlay {
    height: 100%;
    width: 100%;
    display: none; /* Default hide rahega */
    position: fixed;
    z-index: 2000; /* Sabse upar dikhane ke liye */
    top: 0;
    left: 0;
    background-color: rgba(255, 255, 255, 0.95); /* White theme with opacity */
    backdrop-filter: blur(8px); /* Background ko blur karega */
    pointer-events: all;
}

.close-search {
    position: absolute;
    top: 30px;
    right: 5%;
    font-size: 40px;
    cursor: pointer;
    color: var(--text-black);
    transition: 0.3s;
}

.close-search:hover {
    color: var(--spidey-red);
    transform: rotate(90deg); /* Cross ghumega hover pe */
}

.search-content {
    position: relative;
    top: 15%;
    width: 90%;
    max-width: 800px;
    margin: auto;
    text-align: center;
}

.search-content input {
    width: 100%;
    padding: 15px 0;
    font-size: 2rem;
    font-weight: 600;
    border: none;
    border-bottom: 3px solid var(--text-black);
    background: transparent;
    outline: none;
    color: var(--text-black);
    font-family: 'Poppins', sans-serif;
    transition: 0.3s;
}

.search-content input:focus {
    border-bottom-color: var(--spidey-red);
}

.search-results {
    margin-top: 30px;
    text-align: left;
    max-height: 50vh; /* Agar result zyada hon toh scroll aa jaye */
    overflow-y: auto;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #ddd;
    text-decoration: none;
    color: var(--text-black);
    transition: 0.2s;
    background: var(--bg-white);
}

.search-item:hover {
    background-color: var(--grey-light);
    border-left: 5px solid var(--spidey-red); /* Hover pe left side red line */
}

.search-item img {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 20px;
}

/* --- Premium Footer Styling --- */
main {
    flex: 1; /* Ye bachi hui saari space khud le lega, footer ko niche dhakkel dega */
}

.main-footer {
    background-color: var(--text-black);
    color: var(--bg-white);
    padding: 60px 5% 20px;
    margin-top: 80px;
    border-top: 5px solid var(--spidey-red); /* Spidey red top border */
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto 40px auto;
}

.footer-col {
    flex: 1;
    min-width: 250px;
}

.footer-col h3 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: var(--bg-white);
}

.footer-col h3 span {
    color: var(--spidey-red);
}

.footer-col p {
    color: #bbb;
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-col h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--bg-white);
    position: relative;
    display: inline-block;
}

/* Red underline below headings */
.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 3px;
    background-color: var(--spidey-red);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: #bbb;
    transition: 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--spidey-red);
    padding-left: 8px; /* Hover karne pe link thoda aage jayega */
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background-color: #222; /* Dark grey */
    color: var(--bg-white);
    border-radius: 5px;
    font-size: 1.2rem;
    transition: 0.3s;
}

.social-links a:hover {
    background-color: var(--spidey-red);
    transform: translateY(-5px); /* Hover pe button upar uthega */
}

/* Bottom Copyright Section */
.footer-bottom {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 25px;
}

.footer-bottom p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

/* Your Studio Credit */
.studio-credit {
    font-size: 1rem !important;
}

.studio-credit span {
    color: var(--spidey-red);
    font-weight: 600;
    letter-spacing: 1px;
}

/* --- Preloader Styling --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Sabse upar */
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-content {
    text-align: center;
}

/* Spider-Man Pulsing Circle */
.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid var(--grey-light);
    border-top: 6px solid var(--spidey-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loader-text {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: var(--text-black);
    text-transform: uppercase;
}

.loader-text span {
    color: var(--spidey-red);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Isse aap peeche click kar payenge */
}

#mobile-blocker {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: var(--bg-white);
    z-index: 10000;
    display: none; /* JS control karega */
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 25px;
    pointer-events: all; /* Isse aap blocker pe click kar payenge */
}

.blocker-content {
    max-width: 400px;
    padding: 40px 25px;
    border: 3px solid var(--spidey-red);
    border-radius: 20px;
    background: white;
    box-shadow: 0 20px 50px rgba(226, 54, 54, 0.2);
}

.blocker-content i { font-size: 50px; color: var(--spidey-red); margin-bottom: 20px; }
.blocker-content h1 { font-size: 1.6rem; margin-bottom: 15px; }
.blocker-content p b { color: var(--text-black); }
.blocker-content p span { color: var(--spidey-red); font-weight: 800; }

/* Chota Pulsing Circle */
.spidey-loader-small {
    width: 30px; height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--spidey-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto 0;
}

#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--spidey-red);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none; /* Default hide */
    z-index: 1000;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(226, 54, 54, 0.4);
    transition: 0.3s;
}

#backToTop:hover {
    transform: translateY(-5px);
    background: var(--dark-red);
}