/* ============================================
   VARIABLES DE TEMA
   ============================================ */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --bg-color: #f5f5f5;
    --bg-card: #ffffff;
    --text-color: #333333;
    --text-secondary: #666666;
    --border-color: #dddddd;
    --header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --footer-bg: #2c3e50;
    --vip-gold: #ffd700;
    --vip-gradient: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 10px 30px rgba(0,0,0,0.15);
}

/* TEMA OSCURO */
[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --bg-card: #16213e;
    --text-color: #eaeaea;
    --text-secondary: #b0b0b0;
    --border-color: #333355;
    --header-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --footer-bg: #0f0f1a;
    --shadow: 0 2px 10px rgba(0,0,0,0.3);
    --shadow-hover: 0 10px 30px rgba(0,0,0,0.5);
}

/* ============================================
   RESET Y BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   HEADER Y LOGO
   ============================================ */
.header {
    background: var(--header-bg);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

/* LOGO CON ENLACE */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    transition: opacity 0.3s;
}

.logo a:hover {
    opacity: 0.8;
}

.logo-img {
    height: 50px;
    width: auto;
    cursor: pointer;
    transition: transform 0.3s;
}

.logo-img:hover {
    transform: scale(1.05);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.logo h1 a {
    color: white;
}

.logo h1 a:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* BARRA DE BÚSQUEDA */
.search-bar {
    display: flex;
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 5px 0 0 5px;
    font-size: 1rem;
    outline: none;
}

.search-bar button {
    padding: 10px 20px;
    background: #333;
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #555;
}

/* ACCIONES DEL HEADER */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.theme-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.btn-login {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-login:hover {
    background: rgba(255,255,255,0.3);
}

.btn-vip {
    background: var(--vip-gradient);
    color: #000;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 700;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-vip:hover {
    transform: scale(1.05);
}

/* MENÚ DE NAVEGACIÓN */
.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-menu a {
    color: white;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    opacity: 0.8;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://via.placeholder.com/1200x400?text=GameDev+Banner');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 80px 20px;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 25px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-hero {
    background: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.btn-hero:hover {
    opacity: 0.9;
}

.btn-hero-vip {
    background: var(--vip-gradient);
    color: #000;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 700;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-hero-vip:hover {
    transform: scale(1.05);
}

/* ============================================
   VIP BANNER
   ============================================ */
.vip-banner {
    background: var(--vip-gradient);
    padding: 30px 0;
    margin: 20px 0;
}

.vip-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.vip-banner-text h3 {
    font-size: 1.8rem;
    color: #000;
    margin-bottom: 5px;
}

.vip-banner-text p {
    color: #333;
    font-size: 1rem;
}

.btn-vip-large {
    background: #000;
    color: var(--vip-gold);
    padding: 15px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-vip-large:hover {
    transform: scale(1.05);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    display: flex;
    gap: 30px;
    padding: 40px 20px;
    flex-wrap: wrap;
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--bg-card);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.category-list {
    list-style: none;
    margin-bottom: 25px;
}

.category-list li {
    margin-bottom: 10px;
}

.category-list a {
    display: block;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s;
}

.category-list a:hover {
    background: var(--bg-color);
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.filter-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.9rem;
    background: var(--bg-card);
    color: var(--text-color);
}

/* ============================================
   PRODUCTS GRID
   ============================================ */
.products-grid {
    flex: 1;
    min-width: 300px;
}

.products-grid h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--text-color);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* PRODUCT CARD */
.product-card {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* VIP CARD */
.vip-card {
    border: 2px solid var(--vip-gold);
    position: relative;
}

.vip-card::before {
    content: '👑 VIP';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--vip-gradient);
    color: #000;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 10;
}

.product-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.free {
    background: #4CAF50;
    color: white;
}

.badge.vip {
    background: var(--vip-gradient);
    color: #000;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

.product-info .author {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.product-info .description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.4;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-vip {
    font-size: 1rem;
    font-weight: 700;
    color: #ff8c00;
}

.btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-vip-small {
    background: var(--vip-gradient);
    color: #000;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-vip-small:hover {
    transform: scale(1.05);
}

/* ============================================
   SCROLL INFINITO - LOADING
   ============================================ */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.end-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.end-message p {
    margin: 5px 0;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    position: relative;
    animation: slideDown 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
}

.close:hover {
    color: var(--text-color);
}

.modal-content h2 {
    margin-bottom: 25px;
    color: var(--text-color);
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-color);
}

.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group.checkbox input {
    width: auto;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--vip-gradient);
    color: #000;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s;
}

.btn-submit:hover {
    transform: scale(1.02);
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
}

.form-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

.social-login {
    margin-top: 25px;
    text-align: center;
}

.social-login p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    position: relative;
}

.social-login p::before,
.social-login p::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: var(--border-color);
}

.social-login p::before {
    left: 0;
}

.social-login p::after {
    right: 0;
}

.social-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-social {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-card);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-social.google:hover {
    background: #db4437;
    color: white;
    border-color: #db4437;
}

.btn-social.github:hover {
    background: #333;
    color: white;
    border-color: #333;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--footer-bg);
    color: white;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--vip-gold);
}

.footer-section p {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-section ul li a:hover {
    opacity: 1;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    font-size: 1.5rem;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.social-links a:hover {
    opacity: 1;
}

.payment-methods {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.payment-methods img {
    height: 30px;
    border-radius: 3px;
}

.newsletter-form {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
}

.newsletter-form button {
    padding: 10px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.7;
    font-size: 0.9rem;
}

.footer-disclaimer {
    font-size: 0.8rem;
    margin-top: 5px;
}

.footer-logo {
    height: 60px;
    margin-bottom: 15px;
}

/* ============================================
   TAGS CLOUD
   ============================================ */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tag {
    background: var(--bg-color);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.tag:hover {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   PAGINACIÓN
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 10px 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    transition: all 0.3s;
}

.page-btn:hover, .page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }

    .logo {
        justify-content: center;
    }

    .logo-img {
        height: 40px;
    }

    .logo h1 {
        font-size: 1.4rem;
    }

    .search-bar {
        width: 100%;
        margin: 10px 0;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .vip-banner-content {
        flex-direction: column;
        text-align: center;
    }
}
