/* css/style.css */
:root {
    --bg-primary: #f7f7fb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f5;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5a;
    --text-muted: #8a8a9a;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --border: #e5e5ed;
    --border-hover: #c5c5d5;
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.04);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --transition: 0.2s ease;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
    color: inherit;
}

input {
    font-family: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #d0d0de;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #b0b0c0;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.navbar-brand .brand-icon {
    width: 34px;
    height: 34px;
    background: var(--accent-yellow);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.navbar-brand span {
    color: var(--accent-blue);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-link {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 20px;
    transition: var(--transition);
}

.navbar-link:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.navbar-link.active {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
    font-weight: 700;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.user-avatar-small:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.login-btn {
    background: var(--accent-blue);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.login-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Games Section (sin hero) */
.games-section {
    padding: 32px 28px 60px;
    max-width: 1300px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 6px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-yellow);
    border-radius: 2px;
}

/* Search Bar */
.search-container {
    margin-bottom: 24px;
    position: relative;
    max-width: 420px;
}

.search-container input {
    width: 100%;
    padding: 14px 18px 14px 44px;
    border-radius: 25px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
    box-shadow: var(--shadow-sm);
}

.search-container input::placeholder {
    color: var(--text-muted);
}

.search-container input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-container .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Game Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.game-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.game-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.game-card .game-thumbnail {
    aspect-ratio: 16/10;
    background: #e8e8f0;
    overflow: hidden;
    position: relative;
}

.game-card .game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .game-thumbnail img {
    transform: scale(1.06);
}

.game-card .game-thumbnail .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-muted);
    background: #e0e0ea;
}

.game-card .game-info {
    padding: 14px 18px;
}

.game-card .game-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.game-card .game-category {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Badge de categoría con colores */
.game-card .category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    margin-top: 6px;
}

.category-puzzle { background: var(--accent-purple); }
.category-simulation { background: var(--accent-green); }
.category-arcade { background: var(--accent-blue); }
.category-racing { background: var(--accent-red); }
.category-strategy { background: var(--accent-yellow); }
.category-action { background: var(--accent-pink); }
.category-adventure { background: var(--accent-green); }
.category-sports { background: var(--accent-blue); }

.game-card .play-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-green);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.game-card:hover .play-badge {
    opacity: 1;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 28px 28px;
    margin-top: auto;
}

.footer-content {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.footer-brand {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.footer-brand span {
    color: var(--accent-blue);
}

.footer-links {
    display: flex;
    gap: 18px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.75rem;
    width: 100%;
    text-align: center;
    margin-top: 14px;
}

/* Loading Spinner */
.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid var(--border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 9999;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
    background: var(--bg-secondary);
    border-left: 4px solid;
}

.toast.success {
    border-left-color: var(--accent-green);
    color: #065f46;
}

.toast.error {
    border-left-color: var(--accent-red);
    color: #991b1b;
}

.toast.info {
    border-left-color: var(--accent-blue);
    color: #1e40af;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 0 14px;
        height: 60px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }
    
    .games-section {
        padding: 20px 14px 40px;
    }
    
    .section-header h2 {
        font-size: 1.4rem;
    }
    
    .footer {
        padding: 20px 14px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}
/* Añadir al final de css/style.css */

/* Favorite Button */
.favorite-btn {
    position: absolute;
    bottom: 12px;
    right: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    transition: var(--transition);
    cursor: pointer;
    z-index: 5;
}

.favorite-btn:hover {
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
    background: rgba(245, 158, 11, 0.05);
}

.favorite-btn.active {
    background: var(--accent-yellow);
    color: #fff;
    border-color: var(--accent-yellow);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.favorite-btn.active:hover {
    background: #d97706;
    border-color: #d97706;
}

/* Game card needs position relative for favorite button */
.game-card {
    position: relative;
}

/* Space for favorite button */
.game-card .game-info {
    padding-bottom: 44px;
}

/* Favorite count badge in navbar */
.favorites-count {
    background: var(--accent-yellow);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 12px;
    position: absolute;
    top: -4px;
    right: -4px;
}