/* ═══════════════════════════════════════════════════════════
   INPUT PRACTICE PAGE STYLES
   ═══════════════════════════════════════════════════════════ */

/* ─── INTRO CARD ──────────────────────────────────────────── */

.input-intro-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    color: white;
    margin-bottom: 32px;
}

.input-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.input-intro-card h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: white;
}

.input-description {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .input-intro-card {
        padding: 24px 16px;
    }
    
    .input-icon {
        font-size: 48px;
    }
    
    .input-intro-card h1 {
        font-size: 24px;
    }
    
    .input-description {
        font-size: 14px;
    }
}

/* ─── TOPICS TABLE ────────────────────────────────────────── */

.topics-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.topics-table-header {
    display: grid;
    grid-template-columns: 1fr 120px 140px;
    gap: 16px;
    padding: 16px 24px;
    background: #F9FAFB;
    border-bottom: 2px solid #E5E7EB;
    font-weight: 600;
    font-size: 14px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topics-table-row {
    display: grid;
    grid-template-columns: 1fr 120px 140px;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #F3F4F6;
    align-items: center;
    transition: background 0.2s;
}

.topics-table-row:hover {
    background: #F9FAFB;
}

.topics-table-row:last-child {
    border-bottom: none;
}

.topic-name {
    font-size: 16px;
    font-weight: 500;
    color: #1F2937;
}

.topic-word-count {
    font-size: 14px;
    color: #6B7280;
    text-align: center;
}

.topic-action {
    text-align: right;
}

.start-topic-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.start-topic-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .topics-table-header,
    .topics-table-row {
        grid-template-columns: 1fr 80px 100px;
        gap: 12px;
        padding: 16px;
    }
    
    .topic-name {
        font-size: 14px;
    }
    
    .topic-word-count {
        font-size: 13px;
    }
    
    .start-topic-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .topics-table-header {
        display: none;
    }
    
    .topics-table-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .topic-word-count {
        text-align: left;
        font-size: 12px;
    }
    
    .topic-action {
        text-align: left;
    }
    
    .start-topic-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ─── TEST MODE (используем стили из grammar.css) ─────────── */

#input-test {
    display: none;
}

#input-test.active {
    display: block;
}

#topics-list.hidden {
    display: none;
}

/* Скрываем intro карточку когда тест активен */
#input-test.active ~ #topics-list,
.input-intro-card.hidden {
    display: none;
}

/* ─── SESSION STATS ────────────────────────────────────────── */

.session-stats {
    text-align: center;
    margin-top: 20px;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 8px;
    font-size: 14px;
    color: #6B7280;
}

.session-stats strong {
    color: #1F2937;
    font-weight: 600;
}

/* ─── QUESTION PROGRESS ───────────────────────────────────── */

.question-progress {
    text-align: center;
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 16px;
}

/* ─── COMPLETION STATS ────────────────────────────────────── */

.completion-stats {
    background: #F9FAFB;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #E5E7EB;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row.accuracy {
    font-weight: 600;
    font-size: 18px;
    color: var(--primary-color);
    padding-top: 16px;
}

.stat-label {
    color: #6B7280;
}

.stat-value {
    color: #1F2937;
    font-weight: 600;
}

/* ─── BACK BUTTON ──────────────────────────────────────────── */

.back-to-topics-btn {
    background: transparent;
    border: 1px solid #E5E7EB;
    color: #6B7280;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.back-to-topics-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.test-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.topic-title {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    color: #1F2937;
}
/**
 * Grammar / Spelling Mode Styles
 * ─────────────────────────────────────────────────────────
 * Редактируй переменные ниже для быстрого изменения визуала
 * ─────────────────────────────────────────────────────────
 */

/* ═══════════════════════════════════════════
   ПЕРЕМЕННЫЕ — правь здесь
   ═══════════════════════════════════════════ */
:root {
    --sp-key-bg: #F3F4F6;
    --sp-key-bg-hover: #E5E7EB;
    --sp-key-bg-active: #D1D5DB;
    --sp-key-color: #1F2937;
    --sp-key-radius: 6px;

    /* Desktop */
    --sp-key-size: 40px;
    --sp-key-font: 15px;
    --sp-key-gap: 5px;

    /* Mobile */
    --sp-key-size-mob: 32px;
    --sp-key-font-mob: 13px;
    --sp-key-gap-mob: 3px;

    --sp-input-height: 56px;
    --sp-letter-size: 22px;

    --sp-correct: #10B981;
    --sp-wrong: #EF4444;
    --sp-cursor: #6B7280;
}

/* ═══════════════════════════════════════════
   ОБЩИЕ КАРТОЧКИ
   ═══════════════════════════════════════════ */
.spelling-icon {
    font-size: 56px;
    margin-bottom: 12px;
}

.spelling-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1F2937;
}

/* ═══════════════════════════════════════════
   СТАРТОВАЯ КАРТОЧКА
   ═══════════════════════════════════════════ */
.spelling-intro-card {
    text-align: center;
    padding: 48px 32px;
}

.spelling-count-wrap {
    font-size: 18px;
    color: #374151;
    margin-bottom: 28px;
    font-weight: 500;
}

.spelling-count-wrap span {
    font-weight: 700;
    color: #10B981;
}

/* ═══════════════════════════════════════════
   ИНФОРМАЦИОННЫЙ ЭКРАН
   ═══════════════════════════════════════════ */
.spelling-info-screen {
    text-align: center;
    padding: 40px 32px;
    max-width: 480px;
    margin: 0 auto;
}

.spelling-info-list {
    text-align: left;
    display: inline-block;
    margin: 0 auto 20px;
}

.spelling-info-row {
    font-size: 16px;
    padding: 8px 0;
    color: #374151;
}

.spelling-info-note {
    font-size: 14px;
    color: #9CA3AF;
    margin-bottom: 28px;
}

/* ═══════════════════════════════════════════
   ВОПРОС — АУДИО
   ═══════════════════════════════════════════ */
.spelling-question {
    padding: 32px; /* КАК В /learn/ и /review/ */
}

.spelling-audio-wrap {
    text-align: center;
    margin-bottom: 24px;
}

/* ═══════════════════════════════════════════
   КНОПКА АУДИО — ВАРИАНТ 8 (ПУЛЬСИРУЮЩАЯ)
   ═══════════════════════════════════════════ */

.spelling-audio-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #4CAF50;
    border: none;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    font-size: 36px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto;
}

.spelling-audio-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #4CAF50;
    animation: pulse 1.5s infinite;
}

.spelling-audio-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.spelling-audio-btn:active {
    transform: scale(0.95);
}

@keyframes pulse {
    0% { 
        transform: scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: scale(1.5); 
        opacity: 0; 
    }
}

/* Старый стиль - убираем */
.spelling-audio-hint {
    font-size: 13px;
    color: #9CA3AF;
}

/* ═══════════════════════════════════════════
   СТРОКА ВВОДА
   ═══════════════════════════════════════════ */
.spelling-input-wrap {
    margin-bottom: 20px;
}

.spelling-input-display {
    width: 100%;
    min-height: var(--sp-input-height);
    border: 2px solid #D1D5DB;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    background: #FAFAFA;
    box-sizing: border-box;
}

.spelling-letter {
    font-size: var(--sp-letter-size);
    font-weight: 600;
    font-family: monospace;
    color: #1F2937;
    letter-spacing: 1px;
}

.letter-correct {
    color: var(--sp-correct);
}

.letter-wrong {
    color: var(--sp-wrong);
}

.spelling-cursor {
    font-size: var(--sp-letter-size);
    color: var(--sp-cursor);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ═══════════════════════════════════════════
   КЛАВИАТУРА
   ═══════════════════════════════════════════ */
.spelling-keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-key-gap);
    margin-bottom: 16px;
    user-select: none;
}

.spelling-keyboard-row {
    display: flex;
    gap: var(--sp-key-gap);
}

.spelling-key {
    width: var(--sp-key-size);
    height: var(--sp-key-size);
    background: var(--sp-key-bg);
    border: 1px solid #D1D5DB;
    border-radius: var(--sp-key-radius);
    font-size: var(--sp-key-font);
    font-weight: 600;
    color: var(--sp-key-color);
    cursor: pointer;
    transition: background 0.1s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spelling-key:hover:not(:disabled) {
    background: var(--sp-key-bg-hover);
}

.spelling-key:active:not(:disabled) {
    background: var(--sp-key-bg-active);
    transform: scale(0.95);
}

.spelling-key:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════
   КНОПКИ ДЕЙСТВИЙ (Стереть / Проверить)
   ═══════════════════════════════════════════ */
.spelling-actions {
    display: flex;
    justify-content: center; /* По центру вместо space-between */
    gap: 8px; /* Меньше отступ */
    margin-bottom: 12px;
}

.spelling-key-action {
    flex: 1;
    max-width: 150px; /* Ограничение ширины */
    padding: 10px 12px; /* Меньше padding */
    border: 2px solid #D1D5DB;
    border-radius: 8px;
    background: #fff;
    font-size: 13px; /* Было 15px */
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.spelling-key-action:hover:not(:disabled) {
    background: #F3F4F6;
    border-color: #9CA3AF;
}

.spelling-check-btn {
    border-color: #10B981;
    color: #10B981;
}

.spelling-check-btn:hover:not(:disabled) {
    background: #F0FDF4;
    border-color: #059669;
}

.spelling-key-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════
   КНОПКА ДАЛЕЕ
   ═══════════════════════════════════════════ */
.spelling-next-wrap {
    text-align: center;
}

.spelling-next-btn {
    width: 100%;
    max-width: 280px;
}

.spelling-next-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ═══════════════════════════════════════════
   ЭКРАН ЗАВЕРШЕНИЯ
   ═══════════════════════════════════════════ */
.spelling-completion {
    text-align: center;
    padding: 48px 32px;
    max-width: 480px;
    margin: 0 auto;
}

.spelling-completion-text {
    font-size: 20px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 12px;
}

.spelling-completion-note {
    font-size: 15px;
    color: #6B7280;
    line-height: 1.6;
    margin-bottom: 32px;
}

/* ═══════════════════════════════════════════
   ЛОГИН ПРОМПТ
   ═══════════════════════════════════════════ */
.spelling-login-prompt {
    text-align: center;
    padding: 48px 32px;
}

/* ═══════════════════════════════════════════
   МОБИЛЬНЫЕ СТИЛИ
   ═══════════════════════════════════════════ */

/* Для очень узких экранов (< 440px) - iPhone SE, малые Android */
@media (max-width: 480px) {
    .spelling-key {
        width: var(--sp-key-size-mob);
        height: var(--sp-key-size-mob);
        font-size: var(--sp-key-font-mob);
    }

    .spelling-keyboard {
        gap: var(--sp-key-gap-mob);
    }

    .spelling-keyboard-row {
        gap: var(--sp-key-gap-mob);
    }

    .spelling-letter {
        font-size: 18px;
    }

    .spelling-audio-btn {
        font-size: 42px;
    }

    .spelling-question {
        padding: 16px; /* Меньше padding = больше места для кнопок */
    }

    .spelling-info-screen,
    .spelling-intro-card {
        padding: 32px 16px;
    }
    
    /* УВЕЛИЧИВАЕМ КНОПКИ ДЛЯ МОБИЛЬНЫХ */
    :root {
        --sp-key-size-mob: 36px;  /* Было 32px */
        --sp-key-gap-mob: 4px;    /* Было 3px */
    }
}

/* ДЛЯ УЗКИХ ЭКРАНОВ (< 410px) - уменьшаем кнопки */
@media (max-width: 409px) {
    :root {
        --sp-key-size-mob: 30px;  /* Меньше чтобы влезли */
        --sp-key-font-mob: 12px;  /* Меньше шрифт */
        --sp-key-gap-mob: 3px;    /* Меньше отступы */
    }
    
    .spelling-question {
        padding: 12px; /* Минимальный padding */
    }
}

@media (min-width: 1024px) {
    /* Desktop — можно сделать клавиатуру немного больше */
    :root {
        --sp-key-size: 44px;
        --sp-key-font: 16px;
        --sp-key-gap: 6px;
    }

    /* УБРАЛ max-width чтобы ширина была как у test-header (800px) */
    
    .spelling-input-display {
        font-size: 24px;
    }
}

/* Подсказка с русским переводом */
.spelling-hint {
    margin: 16px 0;
    padding: 12px 16px;
    background: #f0f8ff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
    font-size: 16px;
    color: #333;
    text-align: center;
}

.spelling-hint strong {
    color: #0073aa;
    font-weight: 600;
}



/* ═══════════════════════════════════════════════════════════
   SOCIAL LOGIN BUTTON - CENTER ALIGNMENT
   ═══════════════════════════════════════════════════════════ */

.social-login-container {
    text-align: center;
    margin: 20px 0;
}

.social-login-container > div {
    display: inline-block;
}
/* ═══════════════════════════════════════════
   AUDIO CONTAINER (для будущей второй кнопки)
   ═══════════════════════════════════════════ */

.spelling-audio-container {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.audio-button-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.audio-label {
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
}

/* Убираем старые стили .spelling-audio-wrap */
.spelling-audio-wrap {
    text-align: center;
    margin-bottom: 24px;
}

@media (max-width: 480px) {
    .spelling-audio-container {
        gap: 16px;
    }
    
    .audio-label {
        font-size: 12px;
    }
}

/* ═══════════════════════════════════════════
   HINT BUTTON STYLES
   ═══════════════════════════════════════════ */

.spelling-hint-btn {
    border-color: #F59E0B !important;
    color: #F59E0B !important;
}

.spelling-hint-btn:hover:not(:disabled) {
    background: #FEF3C7 !important;
    border-color: #D97706 !important;
}

.spelling-hint-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════
   МОБИЛЬНЫЕ СТИЛИ ДЛЯ КНОПОК ДЕЙСТВИЙ
   ═══════════════════════════════════════════ */

@media (max-width: 480px) {
    .spelling-actions {
        gap: 6px;
    }
    
    .spelling-key-action {
        font-size: 12px;
        padding: 8px 8px;
        max-width: none; /* На мобильных растягиваем */
    }
}

@media (max-width: 409px) {
    .spelling-actions {
        gap: 4px;
    }
    
    .spelling-key-action {
        font-size: 11px;
        padding: 8px 6px;
    }
}

/* ═══════════════════════════════════════════
   HINT FLASH EFFECT (зелёное мигание)
   ═══════════════════════════════════════════ */

.spelling-hint-flash {
    animation: hint-flash 1s ease-out; /* 1 секунда */
    font-weight: 700; /* Жирнее для заметности */
}

@keyframes hint-flash {
    0%, 100% {
        color: #10B981; /* Зелёный */
        text-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
        transform: scale(1.15);
    }
    25% {
        color: #059669; /* Тёмно-зелёный */
        text-shadow: 0 0 12px rgba(5, 150, 105, 0.8);
        transform: scale(1.2);
    }
    50% {
        color: #10B981; /* Зелёный */
        text-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
        transform: scale(1.15);
    }
    75% {
        color: #059669; /* Тёмно-зелёный */
        text-shadow: 0 0 12px rgba(5, 150, 105, 0.8);
        transform: scale(1.2);
    }
}

/* ═══════════════════════════════════════════
   МОБИЛЬНЫЕ СТИЛИ ДЛЯ КНОПКИ АУДИО
   ═══════════════════════════════════════════ */

@media (max-width: 480px) {
    .spelling-audio-btn {
        width: 70px;
        height: 70px;
        font-size: 32px;
    }
    
    .audio-label {
        font-size: 12px;
    }
}

@media (max-width: 409px) {
    .spelling-audio-btn {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
}