/*
 * LearningLand — Global Application Styles v4 · "Amber Solace"
 * All token values come from 00-variables.css
 * ─────────────────────────────────────────────
 * Design: White rounded sidebar · Amber active pills · Warm cards
 * No gradients — solid colors only
 */

/* ═══ RESET & BASE ═══════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--color-text);
    min-height: 100vh;
    width: 100%;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ═══ TYPOGRAPHY ═════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--color-text);
    line-height: 1.25;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-accent-dark);
}

button {
    color: inherit;
    -webkit-text-fill-color: currentColor;
    font-family: var(--font-body);
}

/* ═══ DASHBOARD SHELL ════════════════════════════════════════ */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem 1.5rem;
    gap: 1.5rem;
    z-index: 100;
    box-shadow: 4px 0 32px rgba(143, 78, 0, .08);
    transition: var(--transition);
}

/* ── Mascot Block ── */
.sidebar-mascot {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem;
    background: var(--primary-light);
    border-radius: 24px;
    transition: var(--transition);
}


.mascot-avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: var(--transition);
}

.sidebar-mascot:hover .mascot-avatar {
    transform: scale(1.08);
}

.mascot-label {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mascot-name {
    font-family: var(--font-display);
    font-size: .8rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.2;
}

.mascot-tagline {
    font-size: .68rem;
    font-weight: 600;
    color: var(--ink-secondary);
}

/* ── Nav ── */
.sidebar nav {
    flex: 1;
}

.sidebar nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.sidebar nav li a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-pill);
    color: var(--ink-secondary) !important;
    -webkit-text-fill-color: var(--ink-secondary) !important;
    font-size: .88rem;
    font-weight: 700;
    transition: var(--transition);
}

.sidebar nav li a .material-symbols-outlined {
    font-size: 1.2rem;
    color: var(--ink-muted);
    transition: var(--transition);
}

.sidebar nav li a:hover {
    background: rgba(143, 78, 0, .10);
    color: var(--primary) !important;
    -webkit-text-fill-color: var(--primary) !important;
    transform: translateX(3px);
}

.sidebar nav li a:hover .material-symbols-outlined {
    color: var(--primary);
}

/* Active nav state — amber pill */
.sidebar nav li a.active {
    background: var(--primary);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(143, 78, 0, .30);
}

.sidebar nav li a.active .material-symbols-outlined {
    color: #ffffff;
}

/* ── Streak Widget ── */
.sidebar-streak {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--yellow-light);
    border: 2px solid var(--yellow);
    border-radius: 20px;
    padding: .8rem 1rem;
    margin-top: auto;
    transition: var(--transition);
}

.sidebar-streak:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(253, 153, 55, .25);
}

/* Pulse when streak just incremented */
.sidebar-streak--pulse {
    animation: streak-pulse .55s ease;
}

@keyframes streak-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(253, 153, 55, .20); }
    100% { transform: scale(1); box-shadow: none; }
}

.streak-fire {
    font-size: 1.5rem;
    line-height: 1;
}

.streak-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.streak-count {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--yellow-dark);
    line-height: 1.1;
}

.streak-label {
    font-size: .68rem;
    font-weight: 600;
    color: var(--ink-secondary);
}

/* ═══ STREAK TOAST ═══════════════════════════════════════════ */
#ll-streak-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    display: flex;
    align-items: center;
    gap: .9rem;
    background: var(--yellow-light);
    border: 2.5px solid var(--yellow);
    border-radius: var(--radius-pill);
    padding: .9rem 1.6rem .9rem 1.2rem;
    box-shadow: 0 8px 32px rgba(174, 86, 0, .25);
    z-index: 9999;
    opacity: 0;
    transition: transform .38s cubic-bezier(.34, 1.56, .64, 1), opacity .38s ease;
    pointer-events: none;
    white-space: nowrap;
}

#ll-streak-toast.ll-toast--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.ll-toast-fire {
    font-size: 2rem;
    line-height: 1;
    animation: fire-wiggle .6s ease infinite alternate;
}

@keyframes fire-wiggle {
    from { transform: rotate(-8deg) scale(1); }
    to   { transform: rotate( 8deg) scale(1.15); }
}

.ll-toast-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ll-toast-body strong {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--yellow-dark);
    line-height: 1.2;
}

.ll-toast-body span {
    font-size: .75rem;
    font-weight: 600;
    color: var(--ink-secondary);
}

/* ─── Streak Badge (inline, embeddable in completion screens) ─── */
.ll-streak-badge {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    background: var(--yellow-light);
    border: 2px solid var(--yellow);
    border-radius: var(--radius-pill);
    padding: .6rem 1.2rem .6rem .9rem;
    margin: 1rem auto 0;
}

.ll-streak-badge__fire {
    font-size: 1.4rem;
    line-height: 1;
}

.ll-streak-badge__info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ll-streak-badge__count {
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 800;
    color: var(--yellow-dark);
    line-height: 1.15;
}

.ll-streak-badge__msg {
    font-size: .7rem;
    font-weight: 600;
    color: var(--ink-secondary);
}


/* ─── Main content ─── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    padding: 2rem 2.5rem;
    background: var(--bg);
}

/* Landing page: let .ll-home handle its own padding */
.main-content:has(.ll-home) {
    padding: 0;
}

/* ═══ ACTIVE PHRASE PANEL ════════════════════════════════════ */
.container-phrases {
    display: flex;
    font-weight: 700;
}

.phrases-main-container {
    height: 100vh;
    margin: auto;
}

.phrase .phrase-content {
    margin-top: 100px;
}

.phrase {
    width: 100%;
    text-align: center;
    position: relative;
}

.phrase input {
    width: 100%;
    border: none;
    border-bottom: 2.5px solid var(--primary-light);
    font-size: 20px;
    height: 36px;
    text-align: center;
    background-color: transparent;
    font-family: var(--font-body);
    color: var(--ink);
    transition: border-color .25s;
}

.phrase input:focus {
    outline: none;
    border-bottom-color: var(--primary);
}

.phrase-input-right {
    width: 100%;
    border: none;
    border-bottom: 2.5px solid var(--primary);
    transition: border-bottom .5s ease;
    background-color: transparent;
}

.phrase-input-wrong {
    border-bottom: 2.5px solid var(--coral) !important;
    transition: border-bottom .5s ease;
}

.phrase .phrase-emoji {
    visibility: hidden;
    font-size: 0;
    display: inline-block;
}

.fixed-emoji {
    font-size: 90px;
}

.emoji-active span {
    visibility: visible;
    font-size: 90px;
    transition: visibility .2s, font-size .2s ease;
}

#completePhrase {
    text-align: center;
    margin-bottom: 50px;
    font-family: var(--font-display);
    color: var(--ink);
}

/* ─── Dragging section ─── */
.dragging-section {
    margin: 50px auto;
    width: 55%;
    text-align: center;
}

.dragging-section .drag {
    border: 2px solid var(--primary-light);
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    color: var(--primary-dark);
    background: var(--primary-light);
    margin: 5px;
    font-weight: 800;
    font-size: 1.6rem;
    cursor: grab;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: inline-block;
}

.dragging-section .drag:hover {
    background: var(--primary);
    color: #fff;
    -webkit-text-fill-color: #fff;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px) scale(1.05);
}

/* ═══ ARTICLE ════════════════════════════════════════════════ */
article {
    width: 80%;
    margin: auto;
}

/* ═══ PROGRESS BAR ═══════════════════════════════════════════ */
#ap-progress-wrap {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    background: var(--surface);
    border-radius: var(--radius-pill);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

#ap-progress-bar {
    flex: 1;
    height: 10px;
    background: var(--primary-light);
    border-radius: 99px;
    overflow: hidden;
}

#ap-progress-fill {
    height: 100%;
    background: var(--primary-container);
    border-radius: 99px;
    transition: width .4s ease;
    width: 0%;
}

#ap-progress-label {
    font-size: .8rem;
    font-weight: 800;
    color: var(--ink-muted);
    white-space: nowrap;
}

/* ═══ RESPONSIVE ════════════════════════════════════════════ */
/* ═══ REDUCED MOTION ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .sidebar-streak--pulse { animation: none; }
  .sidebar-mascot:hover { transform: none; }
  .sidebar-streak:hover { transform: none; }
  .sidebar nav li a:hover { transform: none; }
  @keyframes fire-wiggle { from, to { transform: none; } }
}

/* ─── Focus visible for sidebar nav ─── */
.sidebar nav li a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: -1px;
}

.sidebar-mascot:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 768px) {
    .sidebar {
        width: 72px;
        padding: 1rem .5rem;
        gap: 1rem;
        border-radius: 0 20px 20px 0;
    }

    .sidebar-mascot {
        padding: .5rem;
        justify-content: center;
    }

    .mascot-label,
    .mascot-name,
    .mascot-tagline {
        display: none;
    }

    .mascot-avatar {
        width: 40px;
        height: 40px;
    }

    .nav-label {
        display: none;
    }

    .sidebar nav li a {
        padding: .75rem;
        justify-content: center;
    }

    .sidebar nav li a .material-symbols-outlined {
        font-size: 1.4rem;
    }

    .sidebar-streak {
        justify-content: center;
        padding: .6rem;
    }

    .streak-info {
        display: none;
    }

    .main-content {
        margin-left: 72px;
        padding: 1rem;
    }
}
