@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Nunito:wght@500;600;700&display=swap');
@import 'animations.css';

:root {
    --bg-soft: #eef2ff;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-strong: #ffffff;
    --text-main: #1e1b4b;
    --text-muted: #5b6476;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #a5b4fc;
    --accent-pink: #f472b6;
    --accent-emerald: #34d399;
    --accent-amber: #fbbf24;
    --shadow-soft: 0 20px 40px -25px rgba(15, 23, 42, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Nunito', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-soft);
    color: var(--text-main);
    min-height: 100vh;
}

.app-body {
    margin: 0;
    background: radial-gradient(circle at top left, #e0e7ff 0%, #f9fafb 45%, #eef2ff 100%);
    min-height: 100vh;
    position: relative;
}

.app-backdrop {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.app-backdrop__blob {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 999px;
    filter: blur(60px);
    opacity: 0.5;
}

.app-backdrop__blob--one {
    top: -120px;
    left: -60px;
    background: #c4b5fd;
}

.app-backdrop__blob--two {
    right: -80px;
    bottom: -140px;
    background: #f9a8d4;
}

.app-backdrop__grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(79, 70, 229, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 70, 229, 0.07) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.3;
}

.app-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2.5rem 1.5rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.app-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
    z-index: 1;
}

.app-card {
    background: var(--bg-card);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.transition-all {
    transition: all 0.3s ease-in-out;
}

.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.85rem 1.5rem;
    border-radius: 0.85rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: var(--text-main);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.btn-danger {
    background: linear-gradient(135deg, #f87171, #ef4444);
    color: #fff;
}

.btn-link {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.btn-block {
    width: 100%;
}

.nav-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 2rem;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-greeting {
    color: var(--text-muted);
    font-weight: 500;
}

.nav-back-link {
    color: var(--primary);
    font-weight: 600;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-back-link:hover {
    color: var(--primary-dark);
}

.nav-points {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary-dark);
    padding: 0.85rem 1.25rem;
    border-radius: 999px;
    display: flex;
    flex-direction: column;
    min-width: 150px;
    text-align: center;
}

.nav-points__label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.nav-points__value {
    font-size: 1.25rem;
    font-weight: 700;
}

.menu-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-panel {
    position: relative;
    overflow: hidden;
}

.hero-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(236, 72, 153, 0.12));
    z-index: 0;
}

.hero-panel__content,
.hero-panel__stats {
    position: relative;
    z-index: 1;
}

.hero-panel__eyebrow {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.hero-panel__title {
    font-size: clamp(1.75rem, 2vw, 2.4rem);
    margin: 0;
}

.hero-panel__subtitle {
    color: var(--text-muted);
    margin: 0.6rem 0 1.25rem;
    max-width: 580px;
}

.hero-panel__stats {
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.hero-stat {
    background: rgba(255, 255, 255, 0.85);
    padding: 1.25rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.hero-stat__label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.hero-stat__value {
    font-size: 2rem;
    font-weight: 700;
}

.hero-stat__hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hero-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.hero-highlights li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary);
}

.intro-card {
    background: rgba(255, 255, 255, 0.98);
}

.intro-card h3 {
    margin-top: 0;
    font-size: 1.35rem;
}

.intro-card p {
    color: var(--text-muted);
    margin-bottom: 0;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.menu-card {
    position: relative;
    background: var(--bg-card-strong);
    border-radius: 1.25rem;
    padding: 1.5rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px -25px rgba(15, 23, 42, 0.35);
}

.menu-card__emoji {
    font-size: 2.5rem;
}

.menu-card__title {
    margin: 0;
    font-size: 1.25rem;
}

.menu-card__description {
    color: var(--text-muted);
    margin: 0;
    flex: 1;
}

.menu-card__badge {
    align-self: flex-start;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-dark);
    font-weight: 600;
}

.menu-card__cta {
    font-weight: 600;
    color: var(--primary);
}

.menu-card--telegram {
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.9), rgba(221, 214, 254, 0.95));
    border-color: rgba(99, 102, 241, 0.3);
}

.menu-card.accent-indigo {
    border-top: 4px solid var(--primary-light);
}

.menu-card.accent-emerald {
    border-top: 4px solid var(--accent-emerald);
}

.menu-card.accent-amber {
    border-top: 4px solid var(--accent-amber);
}

.menu-card.accent-pink {
    border-top: 4px solid var(--accent-pink);
}

.menu-card.accent-sky {
    border-top: 4px solid #38bdf8;
}

.auth-layout {
    display: flex;
    justify-content: center;
}

.auth-card {
    max-width: 480px;
    width: 100%;
    text-align: left;
}

.auth-card__title {
    margin-top: 0;
    font-size: 1.8rem;
}

.auth-card__subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.eyebrow-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-label {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.input-field {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    font-size: 1rem;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-actions {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.link-button {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
}

.link-button:hover {
    color: var(--primary-dark);
}

@media (max-width: 768px) {
    .app-shell {
        padding: 1.5rem 1rem 2.5rem;
    }

    .nav-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-highlights {
        grid-template-columns: 1fr;
    }

    .app-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .app-shell {
        padding: 1rem;
    }

    .nav-right {
        width: 100%;
        justify-content: space-between;
    }

    .menu-card {
        padding: 1.25rem;
    }
}

/* Style dla modułu matematycznego */
.math-question {
    font-size: 1.875rem;
    font-weight: 700;
    text-align: center;
    margin: 2rem 0;
    color: #312e81;
}

/* Animacje dla kafli matematycznych */
.math-tile {
    transition: all 0.3s ease;
}

.math-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Responsywne obrazki */
.math-image {
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

@keyframes bounce-gentle {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.animate-bounce-gentle {
    animation: bounce-gentle 2s infinite ease-in-out;
}

/* Dodajmy też efekt hover dla kart */
.math-card {
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #ffffff 0%, #f3f4f6 100%);
}

.math-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Dodaj do istniejącego pliku CSS */
.breadcrumb-enter-active,
.breadcrumb-leave-active {
    transition: opacity 0.3s ease;
}

.breadcrumb-enter-from,
.breadcrumb-leave-to {
    opacity: 0;
}

.breadcrumb-item {
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: #4F46E5;
    /* indigo-600 */
}

/* Style dla mnożnika punktów */
.multiplier-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.multiplier-badge:hover {
    transform: scale(1.05);
}

/* Animacja dla mnożnika */
@keyframes glow {

    0%,
    100% {
        filter: brightness(100%);
    }

    50% {
        filter: brightness(120%);
    }
}

.multiplier-badge.animate-bounce-gentle {
    animation:
        bounce-gentle 2s infinite ease-in-out,
        glow 2s infinite ease-in-out;
}

/* Animacja dla zmiany wartości mnożnika */
@keyframes scale-pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.multiplier-value-change {
    animation: scale-pop 0.3s ease-out;
}

/* Główny kontener zadania */
.math-exercise-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    margin: 1rem auto;
    max-width: 800px;
}

/* Styl dla samego zadania */
.math-problem {
    font-size: 3rem;
    font-weight: bold;
    color: #2563eb;
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.1);
    border: 3px solid #e0e7ff;
}

/* Pole wprowadzania odpowiedzi */
.answer-input {
    font-size: 2.5rem;
    width: 200px;
    text-align: center;
    padding: 0.5rem;
    margin: 1rem 0;
    border: 3px solid #93c5fd;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
}

.answer-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* Przyciski odpowiedzi */
.answer-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    max-width: 400px;
}

.answer-button {
    font-size: 2rem;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: #3b82f6;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.answer-button:hover {
    transform: translateY(-2px);
    background: #2563eb;
}

/* Komunikaty zwrotne */
.feedback-message {
    font-size: 1.5rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    margin: 1rem 0;
    animation: pop-in 0.3s ease-out;
}

/* Statystyki */
.stats-container {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 1.2rem;
}

.stat-item {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsywność */
@media (max-width: 768px) {
    .math-problem {
        font-size: 2.5rem;
        padding: 0.8rem 1.5rem;
    }

    .answer-input {
        font-size: 2rem;
        width: 150px;
    }

    .answer-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .math-problem {
        font-size: 2rem;
        padding: 0.6rem 1rem;
    }

    .answer-input {
        font-size: 1.8rem;
        width: 120px;
    }

    .answer-buttons {
        grid-template-columns: 1fr;
    }
}

/* Modal logowania */
.login-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.login-modal {
    background: var(--bg-card-strong);
    border-radius: 1.5rem;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

.login-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.login-modal__close:hover {
    color: var(--text-main);
}

.login-modal__title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    color: var(--text-main);
}

.login-modal__subtitle {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.login-modal__error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

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

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

@media (max-width: 480px) {
    .login-modal {
        padding: 1.5rem;
        margin: 0.5rem;
    }

    .login-modal__title {
        font-size: 1.25rem;
    }
}

/* Strona ustawień */
.settings-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.settings-header__title {
    margin: 0;
    font-size: 1.75rem;
}

.settings-header__subtitle {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-section__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.25rem;
}

.settings-section__icon {
    font-size: 1.5rem;
}

.settings-section__description {
    margin: 0;
    color: var(--text-muted);
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.settings-form__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.settings-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.75rem;
}

.settings-status--success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.settings-status--warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.settings-status__icon {
    font-size: 1.5rem;
}

.settings-status__title {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.settings-status__detail {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.settings-info {
    background: rgba(79, 70, 229, 0.05);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: 0.75rem;
    padding: 1rem;
}

.settings-info__title {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: var(--primary-dark);
}

.settings-info__list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.settings-info__list li {
    margin-bottom: 0.35rem;
}

.settings-info__list code {
    background: rgba(79, 70, 229, 0.1);
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}

.settings-message {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
}

.settings-message--success {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.settings-message--error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Ikona ustawień w NavBar */
.nav-settings-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
}

.nav-settings-btn:hover {
    background: rgba(79, 70, 229, 0.1);
}

@media (max-width: 768px) {
    .settings-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-form__actions {
        flex-direction: column;
    }

    .settings-form__actions .btn {
        width: 100%;
    }
}