/* Variables de color para mantener la estética de tu app */
:root {
    --primary: #4f46e5;       /* Indigo-600 */
    --primary-hover: #4338ca; /* Indigo-700 */
    --danger: #ef4444;        /* Red-500 */
    --danger-hover: #dc2626;  /* Red-600 */
    --success: #16a34a;       /* Green-600 */
    --bg-light: #f3f4f6;      /* Gray-100 */
    --text-main: #1f2937;     /* Gray-800 */
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9fafb;
    color: var(--text-main);
    margin: 0;
}

/* Contenedor principal */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Card del Juego */
.game-card {
    background: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-wrap: wrap; /* Para móviles */
}

.game-card-img {
    width: 100%;
    max-width: 400px;
    object-fit: cover;
}

@media (min-width: 768px) {
    .game-card-img { width: 33.333%; }
    .game-info { width: 66.666%; }
}

.game-info {
    padding: 1.5rem;
}

/* Alerta de Precio Histórico */
.price-alert {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 1rem;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }

/* Tabla de Precios */
.table-container {
    overflow-x: auto;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: var(--bg-light);
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.badge-discount {
    background: var(--danger);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.hidden { display: none; }

/* --- LAYOUT ESTRUCTURA --- */
.navbar {
    background-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    color: white;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-logo-group {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

/* Enlaces del Navbar */
.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: background 0.2s;
}

.nav-link:hover {
    background-color: var(--primary-hover);
}

.btn-link {
    background: none;
    border: none;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
}

.btn-light {
    background-color: white;
    color: var(--primary);
}

.btn-light:hover {
    background-color: var(--bg-light);
}

/* --- ALERTAS --- */
.container-alerts {
    margin-top: 1rem;
}

.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success { background: #dcfce7; border-color: #86efac; color: #166534; }
.alert-warning { background: #fef9c3; border-color: #fde047; color: #854d0e; }
.alert-danger { background: #fee2e2; border-color: #fecaca; color: #991b1b; }

/* --- FOOTER --- */
.footer {
    background-color: #1f2937;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-sub {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.text-center { text-align: center; }
.main-content { padding: 2rem 0; min-height: 70vh; }

/* --- CONTENEDORES DE AUTENTICACIÓN --- */
.auth-container {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 450px;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-main);
}

/* --- ELEMENTOS DE FORMULARIO --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    box-sizing: border-box; /* Crucial para el padding */
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.form-input.is-invalid {
    border-color: var(--danger);
}

.error-text {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

/* --- CHECKBOX Y BOTONES EXTRA --- */
.form-group-check {
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #4b5563;
    cursor: pointer;
}

.btn-full {
    width: 100%;
    padding: 0.75rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.link-primary {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.link-primary:hover {
    text-decoration: underline;
}

.ml-2 { margin-left: 0.5rem; }

@media (max-width: 640px) {
    .auth-container {
        padding: 1rem;
    }
    .auth-card {
        padding: 1.5rem;
    }
}
/* --- ESTILOS DE LA VISTA DE DETALLE --- */
.game-title {
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.price-alert-label { font-weight: bold; margin-bottom: 0.25rem; }
.price-alert-value { font-size: 1.75rem; font-weight: 800; margin: 0.5rem 0; }
.price-alert-date { font-size: 0.875rem; opacity: 0.9; }

.game-actions { margin-top: 2rem; }

/* --- TARJETA DE TABLA --- */
.table-card {
    background: var(--white);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
    overflow: hidden;
}

.table-title {
    padding: 1.5rem;
    margin: 0;
    font-size: 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f9fafb;
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.data-table tr:last-child td { border-bottom: none; }

/* --- UTILIDADES --- */
.font-bold { font-weight: 700; }
.text-success { color: var(--success); }
.empty-state {
    padding: 3rem;
    text-align: center;
    color: #6b7280;
}

/* --- PAGINACIÓN Y TÍTULOS --- */
.page-title { font-size: 1.875rem; color: var(--text-main); margin-bottom: 1.5rem; }
.results-count { color: #6b7280; margin-bottom: 1.5rem; font-size: 0.875rem; }

/* --- FILTROS --- */
.card { background: var(--white); border-radius: 0.75rem; padding: 1.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.card-title { margin-top: 0; margin-bottom: 1rem; font-size: 1.25rem; }
.form-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 1.5rem; 
    margin-bottom: 1.5rem; 
}
.form-actions { display: flex; gap: 0.75rem; }

/* --- GRID DE OFERTAS --- */
.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.deal-card {
    background: var(--white);
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.deal-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 15px rgba(0,0,0,0.1); 
}

.deal-image-container { position: relative; height: 160px; }
.deal-image { width: 100%; height: 100%; object-fit: cover; }
.deal-badge {
    position: absolute; top: 0.5rem; right: 0.5rem;
    background: var(--danger); color: white;
    padding: 0.25rem 0.75rem; border-radius: 9999px;
    font-size: 0.875rem; font-weight: bold;
}

.deal-body { padding: 1rem; flex-grow: 1; display: flex; flex-direction: column; }
.deal-title { font-size: 1rem; margin: 0 0 0.75rem 0; height: 2.5rem; overflow: hidden; }
.deal-pricing { margin-bottom: 0.75rem; }
.price-normal { text-decoration: line-through; color: #9ca3af; font-size: 0.875rem; margin-right: 0.5rem; }
.price-sale { color: var(--success); font-size: 1.5rem; font-weight: 800; }

.deal-rating { font-size: 0.875rem; margin-bottom: 1rem; color: #4b5563; }
.text-yellow { color: #f59e0b; }

.deal-actions { margin-top: auto; display: grid; gap: 0.5rem; }

/* --- BOTONES ADICIONALES --- */
.btn-sm { padding: 0.5rem; font-size: 0.875rem; text-align: center; }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover { background: #d1d5db; }
.btn-success { background: var(--success); color: white; text-decoration: none; border-radius: 0.5rem;}
.btn-success:hover { background: #15803d; }

/* --- HERO SECTION --- */
.hero-card {
    background: var(--white);
    padding: 4rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero-subtitle {
    color: #4b5563;
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
}

.search-form {
    max-width: 700px;
    margin: 0 auto;
}

.search-group {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
}

.btn-search {
    padding: 0 2rem;
}

/* --- SECCIONES --- */
.section { margin-bottom: 4rem; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.section-title { font-size: 1.75rem; margin: 0; }
.text-orange { color: #f97316; }

/* --- FEATURES GRID --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.feature-item {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 0.75rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.feature-title { font-size: 1.25rem; margin-bottom: 0.75rem; color: var(--text-main); }
.feature-desc { color: #6b7280; line-height: 1.5; }

/* Responsive adjustments */
@media (max-width: 640px) {
    .hero-title { font-size: 1.75rem; }
    .search-group { flex-direction: column; }
    .btn-text { margin-left: 0.5rem; }
}
/* --- ESTILOS DE BÚSQUEDA --- */
.search-results-bar {
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.text-primary { color: var(--primary); }
.text-muted { color: #9ca3af; font-size: 0.875rem; }

.price-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

/* Ajuste para el grid de resultados (3 columnas en desktop) */
@media (min-width: 1024px) {
    .deals-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- WISHLIST LAYOUT --- */
.wishlist-container { display: grid; gap: 1rem; margin-bottom: 3rem; }
.wishlist-item { padding: 0; overflow: hidden; }

.wishlist-flex { display: flex; flex-direction: column; }
@media (min-width: 768px) { .wishlist-flex { flex-direction: row; } }

.wishlist-image-wrapper { width: 100%; height: 200px; }
@media (min-width: 768px) { .wishlist-image-wrapper { width: 250px; height: auto; } }
.wishlist-image { width: 100%; height: 100%; object-fit: cover; }

.wishlist-content { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 768px) { .wishlist-content { flex-direction: row; justify-content: space-between; align-items: center; } }

.wishlist-main-info { flex: 1; }
.wishlist-game-title { font-size: 1.5rem; margin-bottom: 1rem; color: var(--text-main); }

.wishlist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.price-stat { display: flex; flex-direction: column; }
.stat-label { font-size: 0.75rem; text-transform: uppercase; color: #6b7280; font-weight: bold; margin-bottom: 0.25rem; }

.price-history { color: #2563eb; font-weight: bold; font-size: 1.25rem; }
.price-target { color: var(--primary); font-weight: bold; font-size: 1.25rem; }

/* --- FORMULARIOS SM --- */
.update-price-form { max-width: 300px; }
.input-group { display: flex; gap: 0.5rem; }
.input-sm { padding: 0.4rem 0.75rem; font-size: 0.875rem; }
.alert-sm { padding: 0.5rem 1rem; font-size: 0.875rem; margin-bottom: 1rem; }

/* --- BOTONES EXTRAS --- */
.btn-danger-outline { border: 2px solid var(--danger); color: var(--danger); background: transparent; }
.btn-danger-outline:hover { background: var(--danger); color: white; }
.wishlist-actions { display: flex; gap: 0.5rem; flex-direction: column; min-width: 150px; }

/* --- SUMMARY & EMPTY STATE --- */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.summary-item { padding: 1.5rem; border-radius: 0.5rem; text-align: center; display: flex; flex-direction: column; }
.summary-value { font-size: 2rem; font-weight: 800; }
.summary-label { color: #4b5563; font-weight: 500; }

.bg-primary-light { background: #eef2ff; color: var(--primary); }
.bg-success-light { background: #f0fdf4; color: var(--success); }
.bg-info-light { background: #eff6ff; color: #1e40af; }

.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { font-size: 4rem; color: #d1d5db; margin-bottom: 1.5rem; }