/* ============================================================
 * Chromind — style.css v2.0
 * Variables, Bootstrap overrides, y sistema de notificaciones
 * Paleta:  #D9DFFF (fondo)  |  #003B59 (acento)
 * Fonts:   Nunito (títulos) |  Quicksand (cuerpo)
 * ============================================================ */

/* ─── Variables CSS ────────────────────────────────────────── */
:root {
    --color-bg:           #D9DFFF;
    --color-bg-light:     #EDF0FF;
    --color-accent:       #003B59;
    --color-accent-light: #005580;
    --color-accent-soft:  rgba(0, 59, 89, 0.08);
    --color-white:        #ffffff;
    --color-text:         #1a2332;
    --color-text-muted:   #5a6a7a;

    --color-success:      #22c55e;
    --color-success-bg:   rgba(34, 197, 94, 0.12);
    --color-info:         #3b82f6;
    --color-info-bg:      rgba(59, 130, 246, 0.12);
    --color-error:        #ef4444;
    --color-error-bg:     rgba(239, 68, 68, 0.12);

    --radius:             1.5rem;
    --radius-sm:          1rem;
    --radius-xs:          0.5rem;
    --shadow:             0 4px 24px rgba(0, 59, 89, 0.08);
    --shadow-lg:          0 8px 40px rgba(0, 59, 89, 0.12);
    --transition:         all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --font-heading:       'Nunito', sans-serif;
    --font-body:          'Quicksand', sans-serif;
}

/* ─── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-accent);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-accent-light);
}

/* ─── Bootstrap Overrides ──────────────────────────────────── */

/* Cards */
.card,
.card-body {
    border-radius: var(--radius) !important;
    border: none;
}

.card {
    box-shadow: var(--shadow);
    background: var(--color-white);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

/* Botones */
.btn {
    border-radius: var(--radius) !important;
    font-family: var(--font-body);
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    transition: var(--transition);
    border: none;
}

.btn-primary,
.btn-chromind {
    background: var(--color-accent) !important;
    color: var(--color-white) !important;
    border: none !important;
}

.btn-primary:hover,
.btn-chromind:hover {
    background: var(--color-accent-light) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 59, 89, 0.25);
}

.btn-outline-primary,
.btn-chromind-outline {
    background: transparent !important;
    color: var(--color-accent) !important;
    border: 2px solid var(--color-accent) !important;
    border-radius: var(--radius) !important;
}

.btn-outline-primary:hover,
.btn-chromind-outline:hover {
    background: var(--color-accent) !important;
    color: var(--color-white) !important;
}

/* Form controls */
.form-control,
.form-select {
    border-radius: var(--radius-sm) !important;
    border: 2px solid rgba(0, 59, 89, 0.15);
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-weight: 500;
    transition: var(--transition);
    background: var(--color-white);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px rgba(0, 59, 89, 0.1);
}

/* Modals */
.modal-content {
    border-radius: var(--radius) !important;
    border: none;
}

/* ─── Topbar / Navbar (Mobile-first) ───────────────────────── */
.chromind-topbar {
    background: var(--color-white);
    padding: 0.6rem 0.75rem;
    box-shadow: 0 2px 12px rgba(0, 59, 89, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.chromind-topbar .brand {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-accent);
    text-decoration: none;
    flex-shrink: 0;
}

.chromind-topbar .brand i {
    font-size: 1.2rem;
    color: var(--color-accent);
}

.chromind-topbar .user-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.chromind-topbar .user-name {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.8rem;
    display: none;
}

.chromind-topbar .topbar-btn {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
    border-radius: var(--radius-xs);
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-body);
    white-space: nowrap;
}

.chromind-topbar .topbar-btn:hover {
    background: var(--color-accent);
    color: var(--color-white);
}

/* Btn text hidden on small screens, icon always visible */
.chromind-topbar .topbar-btn .btn-text {
    display: none;
}

.chromind-topbar .btn-logout {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 2px solid transparent;
    border-radius: var(--radius-xs);
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.chromind-topbar .btn-logout .btn-text { display: none; }

.chromind-topbar .btn-logout:hover {
    background: var(--color-error);
    color: var(--color-white);
}

/* ─── Dashboard (Mobile-first) ─────────────────────────────── */
.dashboard-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
}

.dashboard-hero {
    text-align: center;
    padding: 1.25rem 0 1rem;
}

.dashboard-hero h1 {
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
}

.dashboard-hero p {
    color: var(--color-text-muted);
    font-size: 0.88rem;
    max-width: 480px;
    margin: 0 auto;
}

.section-label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ─── Game Cards (Mobile-first: horizontal layout) ─────────── */
.game-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.game-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 0.85rem 1rem;
    gap: 0.75rem;
    background: var(--color-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--color-text);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-accent);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    opacity: 0;
    transition: var(--transition);
}

.game-card:hover,
.game-card:active {
    box-shadow: var(--shadow-lg);
    color: var(--color-text);
    text-decoration: none;
}

.game-card:hover::before {
    opacity: 1;
}

.game-card .game-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.game-card:hover .game-icon {
    transform: scale(1.08);
}

.game-card-info {
    flex: 1;
    min-width: 0;
}

.game-card h4 {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-accent);
    line-height: 1.3;
}

.game-card p {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin: 2px 0 0;
    line-height: 1.3;
    display: none;
}

/* Game icon colors */
.icon-schulte     { background: #e8f0fe; color: #1a73e8; }
.icon-stroop      { background: #fce4ec; color: #e91e63; }
.icon-speed       { background: #fff3e0; color: #ff9800; }
.icon-pattern     { background: #e8f5e9; color: #4caf50; }
.icon-tracking    { background: #f3e5f5; color: #9c27b0; }
.icon-pairs       { background: #e0f7fa; color: #00bcd4; }
.icon-reading     { background: #fbe9e7; color: #ff5722; }
.icon-search      { background: #e8eaf6; color: #3f51b5; }
.icon-sequential  { background: #fff9c4; color: #f9a825; }

/* ─── Auth Pages ───────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    padding: 1rem;
}

.auth-card {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.75rem;
    width: 100%;
    max-width: 440px;
}

.auth-card .brand-area {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-card .brand-area i {
    font-size: 2.5rem;
    color: var(--color-accent);
    display: block;
    margin-bottom: 0.5rem;
}

.auth-card .brand-area h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--color-accent);
}

.auth-card .brand-area p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.auth-card .form-group {
    margin-bottom: 1rem;
}

.auth-card .form-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text);
    margin-bottom: 0.3rem;
    display: block;
}

.auth-card .input-icon-wrapper {
    position: relative;
}

.auth-card .input-icon-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.auth-card .input-icon-wrapper .form-control {
    padding-left: 2.5rem;
}

.auth-card .btn-submit {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.auth-card .auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

.auth-card .auth-footer a {
    font-weight: 700;
    color: var(--color-accent);
}

.auth-card .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.auth-card .back-link:hover {
    color: var(--color-accent);
}

/* ══════════════════════════════════════════════════════════════
 * SISTEMA DE NOTIFICACIONES TOAST (Custom)
 * ══════════════════════════════════════════════════════════════ */

#notification-container {
    position: fixed;
    top: 1.25rem;
    right: 0.75rem;
    left: 0.75rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    width: auto;
    max-width: none;
}

.toast-notification {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    background: rgba(26, 35, 50, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    animation: toast-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    cursor: default;
}

.toast-notification.toast-exit {
    animation: toast-slide-out 0.35s ease-in forwards;
}

.toast-notification::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.toast-notification.toast-success::after { background: var(--color-success); }
.toast-notification.toast-info::after    { background: var(--color-info); }
.toast-notification.toast-error::after   { background: var(--color-error); }

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-success .toast-icon { background: var(--color-success-bg); color: var(--color-success); }
.toast-info .toast-icon    { background: var(--color-info-bg); color: var(--color-info); }
.toast-error .toast-icon   { background: var(--color-error-bg); color: var(--color-error); }

.toast-content { flex: 1; min-width: 0; }
.toast-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
    margin-bottom: 2px;
    line-height: 1.3;
}

.toast-message {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}
.toast-close:hover { color: rgba(255, 255, 255, 0.8); }

@keyframes toast-slide-in {
    0%   { opacity: 0; transform: translateX(100%) scale(0.9); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-slide-out {
    0%   { opacity: 1; transform: translateX(0) scale(1); }
    100% { opacity: 0; transform: translateX(100%) scale(0.9); }
}

/* ─── Utility ──────────────────────────────────────────────── */
.text-accent { color: var(--color-accent) !important; }
.bg-accent   { background-color: var(--color-accent) !important; }
.rounded-xl  { border-radius: var(--radius) !important; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — tablet & desktop enhancements
   ═══════════════════════════════════════════════════════════════ */

/* ─── ≥ 420px: show btn text and user name ─────────────────── */
@media (min-width: 420px) {
    .chromind-topbar .topbar-btn .btn-text { display: inline; }
    .chromind-topbar .btn-logout .btn-text { display: inline; }
    .chromind-topbar .user-name { display: block; }
}

/* ─── ≥ 576px: 2-column game grid, show descriptions ──────── */
@media (min-width: 576px) {
    .chromind-topbar {
        padding: 0.75rem 1.25rem;
    }
    .chromind-topbar .brand { font-size: 1.2rem; }
    .chromind-topbar .user-area { gap: 0.75rem; }

    .dashboard-container { padding: 1.25rem; }
    .dashboard-hero h1 { font-size: 1.6rem; }
    .dashboard-hero { padding: 1.5rem 0 1.25rem; }

    .game-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .game-card p { display: block; }
    .game-card { padding: 0.9rem 1.1rem; }
}

/* ─── ≥ 768px: bigger topbar, 2-col grid ──────────────────── */
@media (min-width: 768px) {
    .chromind-topbar {
        padding: 0.75rem 1.5rem;
        border-radius: 0 0 var(--radius) var(--radius);
    }
    .chromind-topbar .brand { font-size: 1.35rem; gap: 0.5rem; }
    .chromind-topbar .brand i { font-size: 1.5rem; }
    .chromind-topbar .user-area { gap: 1rem; }
    .chromind-topbar .user-name { font-size: 0.95rem; }
    .chromind-topbar .topbar-btn { padding: 0.4rem 0.85rem; font-size: 0.82rem; }

    .dashboard-container { padding: 1.5rem; }
    .dashboard-hero h1 { font-size: 1.8rem; }
    .dashboard-hero p { font-size: 1rem; }
    .section-label { font-size: 1.1rem; }

    .game-card { padding: 1rem 1.2rem; gap: 0.9rem; }
    .game-card .game-icon { width: 48px; height: 48px; min-width: 48px; font-size: 1.25rem; }
    .game-card h4 { font-size: 0.92rem; }

    #notification-container {
        right: 1.25rem;
        left: auto;
        max-width: 400px;
        width: calc(100% - 2.5rem);
    }
}

/* ─── ≥ 992px: 3-column grid, largest sizes ───────────────── */
@media (min-width: 992px) {
    .game-grid { grid-template-columns: 1fr 1fr 1fr; gap: 0.85rem; }
    .dashboard-hero h1 { font-size: 2rem; }
    .dashboard-hero p { font-size: 1.05rem; }

    .game-card .game-icon { width: 52px; height: 52px; min-width: 52px; font-size: 1.35rem; }
    .game-card h4 { font-size: 0.95rem; }
    .game-card p { font-size: 0.78rem; }
    .game-card { padding: 1rem 1.3rem; }

    .auth-card { padding: 2.5rem; }
}
