/* styles.css - Hoja de estilos premium y responsiva para CromoSwap */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #0b0716;
    --bg-card: #140e29;
    --bg-card-hover: #1e153c;
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-light: #a78bfa;
    --secondary: #db2777;
    --secondary-hover: #be185d;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --border-color: rgba(124, 58, 237, 0.2);
    --border-hover: rgba(124, 58, 237, 0.5);
    --glass-bg: rgba(20, 14, 41, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --font: 'Outfit', sans-serif;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #ffffff;
}

/* Contenedor principal */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* NAVBAR */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    background: var(--secondary);
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    -webkit-text-fill-color: #fff;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
    list-style: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-secondary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary-light);
}

.btn-secondary:hover {
    background: rgba(124, 58, 237, 0.1);
    color: #fff;
}

.btn-danger {
    background: #ef4444;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-pink {
    background: var(--secondary);
}
.btn-pink:hover {
    background: var(--secondary-hover);
}

.btn-block {
    width: 100%;
}

.user-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-badge .indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

/* HERO SECTION (Index) */
.hero {
    padding: 80px 0;
    text-align: center;
    background: radial-gradient(circle at top, rgba(124, 58, 237, 0.15) 0%, transparent 60%);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero h1 span {
    background: linear-gradient(135deg, #a78bfa 0%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px auto;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

/* TARJETAS DE CARACTERÍSTICAS */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    text-align: left;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary-light);
}

.feature-card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* FORMULARIOS (Login / Registro) */
.form-wrapper {
    max-width: 500px;
    width: 100%;
    margin: 60px auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    box-shadow: var(--shadow);
}

.form-wrapper h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.form-wrapper p.subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 1rem;
    transition: all 0.3s ease;
}

select.form-control, select.form-control:focus {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}

select.form-control option {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 25px 0;
}

.checkbox-group input {
    margin-top: 4px;
}

.checkbox-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* PANEL DE CONTROL (DASHBOARD) */
.dashboard-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    margin: 40px 0;
}

@media (max-width: 992px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
}

.dashboard-card h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-card h3 span {
    font-size: 0.8rem;
    background: rgba(124, 58, 237, 0.2);
    color: var(--primary-light);
    padding: 2px 8px;
    border-radius: 20px;
}

/* LISTAS DE ESTAMPAS (Grids) */
.stickers-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .stickers-container {
        grid-template-columns: 1fr;
    }
}

.sticker-list-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 25px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 15px;
    align-content: start;
    flex-grow: 1;
}

.sticker-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.sticker-badge:hover {
    border-color: var(--primary-light);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.sticker-code {
    font-weight: 700;
    color: var(--secondary);
    font-size: 0.95rem;
}

.sticker-name {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 4px 0 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sticker-team {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.sticker-qty {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.sticker-remove {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sticker-badge:hover .sticker-remove {
    opacity: 1;
}

/* SISTEMA DE COINCIDENCIAS (Alerts / Matches) */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.match-item {
    background: rgba(124, 58, 237, 0.05);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.match-item:hover {
    background: rgba(124, 58, 237, 0.08);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.match-user {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
}

.match-location {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.match-body {
    font-size: 0.9rem;
    color: var(--text-main);
}

.match-body span.highlight {
    color: var(--secondary);
    font-weight: 700;
}

.match-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

/* ESCÁNER QR MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 30px;
    position: relative;
    box-shadow: var(--shadow);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #fff;
}

.modal h2 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

/* Contenedor de cámara */
.scanner-viewport {
    width: 100%;
    height: 280px;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    border: 2px solid var(--primary);
    margin-bottom: 20px;
}

/* Animación de rayo láser simulado */
.scanner-laser {
    position: absolute;
    width: 100%;
    height: 3px;
    background: rgba(236, 72, 153, 0.8);
    box-shadow: 0 0 12px 2px rgba(236, 72, 153, 1);
    top: 0;
    z-index: 10;
    animation: laserScan 2s linear infinite;
}

@keyframes laserScan {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

/* FORMULARIO DE DETALLES DE ESTAMPA EN MODAL */
.sticker-form-popup {
    display: none;
    animation: fadeIn 0.3s ease;
}

.sticker-form-popup.active {
    display: block;
}

/* PASARELA DE PAGO */
.payment-modal-body {
    text-align: center;
}

.payment-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--success);
    margin: 15px 0;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.payment-method-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.payment-method-btn.active, .payment-method-btn:hover {
    border-color: var(--secondary);
    background: rgba(219, 39, 119, 0.1);
}

.credit-card-form {
    text-align: left;
    margin-top: 15px;
}

/* BUSCADOR GENERAL (Search.php) */
.search-wrapper {
    margin: 30px 0;
}

.search-filters {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

@media (max-width: 768px) {
    .search-filters {
        grid-template-columns: 1fr;
    }
}

.search-results {
    margin-top: 30px;
}

/* Toast Notificaciones flotantes */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--success);
    color: #fff;
    padding: 15px 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast.show {
    transform: translateX(0);
}

/* FOOTER LEGAL */
footer {
    margin-top: auto;
    background: #06040c;
    border-top: 1px solid var(--glass-border);
    padding: 40px 0 20px 0;
    text-align: center;
    color: var(--text-muted);
}

.footer-content p {
    font-size: 0.9rem;
    max-width: 800px;
    margin: 0 auto 15px auto;
    line-height: 1.5;
}

.footer-disclaimer {
    border: 1px solid rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.05);
    padding: 15px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    max-width: 800px;
    margin: 20px auto 0 auto;
    color: #fca5a5;
}

.footer-copy {
    margin-top: 25px;
    font-size: 0.8rem;
}

/* Spinner de carga */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

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