* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1b5e20;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Глобальный, тонкий, почти незаметный скролл */
* {
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

/* WebKit-браузеры (Chrome, Edge, Safari) */
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    transition: background 0.3s;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}


/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid #c8e6c9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f1f8e9;
}

button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    transform: translateY(-5px);
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white !important;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #66bb6a, #4caf50);
}

.notification.error {
    background: linear-gradient(135deg, #ef5350, #e53935);
}

.notification.info {
    background: linear-gradient(135deg, #42a5f5, #1976d2);
}

/* Dashboard Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    margin-top: 90px;
}


header h1 {
    color: #1b5e20;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #2e7d32;
    font-weight: 500;
}


.logout-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ef5350, #e53935);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    width: auto;
    font-size: 14px;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #e53935, #d32f2f);
    transform: translateY(-2px);
}

.training-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stats-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    transition: all 0.3s;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.stats-section h2 {
    margin-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    /* text-align: center;  */
    padding: 20px;
    background: linear-gradient(74deg, #e6ffe87d, #c8e6c947);
    border-radius: 10px;
    border: 2px solid #a5d6a7;
}

.stat-item h3 {
    /* color: #2e7d32; */
    margin-bottom: 10px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    /* color: #1b5e20; */
}

.mode-stat {
    background: #f5f5f5;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

.best-time {
    color: #ff8f00;
    font-weight: bold;
    margin-left: 10px;
}

.leaderboard-section {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    border: 2px solid #a5d6a7;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    margin: 5px 0;
    background: #f1f8e9;
    border-radius: 5px;
    border-left: 4px solid #4caf50;
}

/* Training Styles */
.training-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.training-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    backdrop-filter: blur(5px);
}

.stats {
    font-size: 18px;
    font-weight: 500;
    color: #1b5e20;
}

.timer {
    font-size: 24px;
    font-weight: bold;
    color: #4caf50;
}

.finish-btn {
    width: auto;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ef5350, #e53935);
}

.finish-btn:hover {
    background: linear-gradient(135deg, #e53935, #d32f2f);
}

.question-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 20px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    position: relative;
}

.options-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.option-btn:hover {
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    border-color: #4caf50;
    transform: translateY(-2px);
}

.option-btn.correct {
    background: linear-gradient(135deg, #66bb6a, #4caf50);
    color: white;
    border-color: #66bb6a;
}

.next-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    font-weight: 600;
}

.next-btn:hover {
    background: linear-gradient(135deg, #43a047, #388e3c);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.next-btn:active {
    transform: translateY(0);
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .next-btn {
        padding: 14px 30px;
        font-size: 16px;
        width: 100%;
    }

    .stats-section {
        padding: 15px;
    }
}

.completion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000b3;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.completion-content {
    background: linear-gradient(135deg, #e8f5e9, #ebebeb);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border: 3px solid #4caf50;
}

.completion-content h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.completion-stats {
    font-size: 1.2em;
    margin: 15px 0;

    padding: 25px;
    border-radius: 10px;
}

.completion-stats p {
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .training-header {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
        text-align: center;
    }

    .word-display {
        font-size: 36px;
    }

    .options-container {
        grid-template-columns: 1fr;
    }

    .login-form {
        padding: 25px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .training-modes {
        grid-template-columns: 1fr;
    }

    .mode-card {
        padding: 20px;
    }

    .completion-content {
        padding: 30px 20px;
    }

    .completion-content h2 {
        font-size: 2em;
    }

    .word-display {
        font-size: 28px;
    }
}


.settings-group {
    margin-bottom: 15px;
}

.max-words {
    color: #ff8f00;
    font-weight: bold;
    margin-left: 10px;
}

/* Стили для экрана завершения бесконечных режимов */
.infinite-completion .completion-stats {
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
}

.word-count-badge {
    display: inline-block;
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    margin: 5px;
    font-size: 1.1em;
}

.record-badge {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Стили для таблицы лидеров */
.leaderboard-section {
    margin-top: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid #e8f5e9;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin: 8px 0;
    background: linear-gradient(135deg, #f8ffed, #f1ffdf);
    border-radius: 10px;
    border-left: 4px solid #4caf50;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.leaderboard-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f1ffdf, #e8f5cc);
}

.leaderboard-item:nth-child(even) {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-left-color: #66bb6a;
}

.leaderboard-item:nth-child(even):hover {
    background: linear-gradient(135deg, #c8e6c9, #a5d6a7);
}

/* Стили для первых трех мест */
.leaderboard-item:first-child {
    background: linear-gradient(135deg, #fff9c4, #fff59d);
    border-left: 4px solid #ffd600;
}

.leaderboard-item:nth-child(2) {
    background: linear-gradient(135deg, #e0e0e0, #bdbdbd);
    border-left: 4px solid #9e9e9e;
}

.leaderboard-item:nth-child(3) {
    background: linear-gradient(135deg, #ffccbc, #ffab91);
    border-left: 4px solid #ff7043;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .leaderboard-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 15px;
    }

    .leaderboard-item>div:last-child {
        margin-top: 8px;
        text-align: left !important;
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .leaderboard-section {
        padding: 15px;
    }
}

/* Анимации */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.leaderboard-item {
    animation: slideInFromBottom 0.5s ease forwards;
}

/* Стили для карточек импорта */
.import-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.import-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.1);
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    backdrop-filter: blur(10px);
}

.import-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(76, 175, 80, 0.2);
    border-color: #4caf50;
}


.import-card h3 {
    color: #1b5e20;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.import-card p {
    color: #2e7d32;
    margin-bottom: 20px;
    line-height: 1.5;
}

.import-btn {
    display: inline-block;
    padding: 12px 25px;
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
}

.import-btn:hover {
    background: linear-gradient(135deg, #43a047, #388e3c);
    transform: translateY(-2px);
}

.trancy-link {
    background: linear-gradient(135deg, #f94d4de6, #f15c25db) !important;
}


/* Специфичные стили для каждой карточки импорта */
.import-card[data-source="manual"] {
    border-left: 4px solid #4caf50;
}

.import-card[data-source="duolingo"] {
    border-left: 4px solid #58cc02;
}

.import-card[data-source="trancy"] {
    border-left: 4px solid #ff6b35;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .import-cards {
        grid-template-columns: 1fr;
    }

    .import-card {
        padding: 20px;
    }
}

.example-import {
    padding: 15px;
    border-radius: 5px;
}

/* Стили для выбора источника */
.settings-group {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 10px;
}

.settings-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 1.1em;
}

.settings-select {
    width: 100%;
    padding: 14px;
    border: 2px solid #c8e6c9;
    border-radius: 8px;
    font-size: 16px;
    color: #1b5e20;
    font-weight: 500;
}


/* Улучшенные стили для карточек режимов */
.training-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #4caf50, #43a047);
}


/* Стили для модального окна плагинов */
.plugin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.plugin-modal {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.plugin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e8f5e9;
    border-radius: 15px 15px 0 0;
}

.plugin-modal-header h2 {
    margin: 0;
}

.close-modal {
    border: none;
    font-size: 2em;
    cursor: pointer;
    transition: color 0.3s;
    width: 15%;
}

.close-modal:hover {
    color: #e53935;
}

.plugin-modal-body {
    padding: 25px;
}

.instructions {
    margin: 20px 0;
}

.instructions h4 {
    margin-bottom: 10px;
}

.instructions ol {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.plugin-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.download-btn {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s;
}

.download-btn:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    transform: translateY(-2px);
}

.close-btn {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #ef5350, #e53935);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.close-btn:hover {
    background: linear-gradient(135deg, #e53935, #d32f2f);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .plugin-actions {
        flex-direction: column;
    }

    .plugin-modal {
        width: 95%;
    }
}

/* Стили для карточек режимов - 2 ряда по 2 карточки */
.training-modes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Всегда 2 колонки */
    gap: 25px;
    margin-bottom: 40px;
}

.mode-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    min-height: 180px;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #4caf50, #43a047);
}

.mode-card:hover {
    transform: translateY(-8px);
}

.mode-card h3 {
    margin-bottom: 12px;
    font-size: 1.4em;
    line-height: 1.2;
}

.mode-card p {
    margin-bottom: 8px;
    font-size: 1em;
    line-height: 1.4;
}

.mode-info {
    font-size: 0.9em;
    margin-top: 10px;
    font-style: italic;
    padding: 5px 10px;
    border-radius: 15px;
    display: inline-block;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .training-modes {
        grid-template-columns: 1fr;
        /* На мобильных - 1 колонка */
        gap: 20px;
    }

    .mode-card {
        padding: 25px 20px;
        min-height: 160px;
    }

    .mode-card h3 {
        font-size: 1.3em;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .training-modes {
        gap: 15px;
    }

    .mode-card {
        padding: 20px 15px;
        min-height: 140px;
    }

    .mode-card h3 {
        font-size: 1.2em;
    }

    .mode-card p {
        font-size: 0.9em;
    }
}

/* Цветовые акценты для разных типов режимов */
.mode-card[data-mode="time_words"]::before {
    background: linear-gradient(135deg, #4caf50, #43a047);
}

.mode-card[data-mode="time_audio"]::before {
    background: linear-gradient(135deg, #2196f3, #1976d2);
}

.mode-card[data-mode="infinite_words"]::before {
    background: linear-gradient(135deg, #f73535, #e94d4d);
}

.mode-card[data-mode="infinite_audio"]::before {
    background: linear-gradient(135deg, #ffcf40, #ffb90e);
}

/* Иконки для карточек режимов (опционально) */
.mode-card::after {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    opacity: 0.7;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.mode-card[data-mode="time_words"]::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2343a047"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/></svg>');
}

.mode-card[data-mode="time_audio"]::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%231976d2"><path d="M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"/></svg>');
}

.mode-card[data-mode="infinite_words"]::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e94d4d"><path d="M18.6 6.62c-1.44 0-2.8.56-3.77 1.53L12 10.66 10.48 12h.01L7.8 14.39c-.64.64-1.49.99-2.4.99-1.87 0-3.39-1.51-3.39-3.38S3.53 8.62 5.4 8.62c.91 0 1.76.35 2.44 1.03l1.13 1 1.51-1.34L9.22 8.2C8.2 7.18 6.84 6.62 5.4 6.62 2.42 6.62 0 9.04 0 12s2.42 5.38 5.4 5.38c1.44 0 2.8-.56 3.77-1.53l2.83-2.5.01.01L13.52 12h-.01l2.69-2.39c.64-.64 1.49-.99 2.4-.99 1.87 0 3.39 1.51 3.39 3.38s-1.52 3.38-3.39 3.38c-.9 0-1.76-.35-2.44-1.03l-1.14-1.01-1.51 1.34 1.27 1.12c1.02 1.01 2.37 1.57 3.82 1.57 2.98 0 5.4-2.41 5.4-5.38s-2.42-5.37-5.4-5.37z"/></svg>');
}

.mode-card[data-mode="infinite_audio"]::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffb90e"><path d="M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6zm-1.56 15.85c-.31.09-.63.15-.97.15-1.38 0-2.5-.95-2.5-2.5s1.12-2.5 2.5-2.5c.34 0 .66.06.97.15-.21.58-.33 1.2-.33 1.85s.12 1.27.33 1.85z"/></svg>');
}

/* Audio Player Styles */
.audio-player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.audio-visualizer {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #4caf50, #43a047);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.audio-visualizer:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.4);
}

.audio-visualizer.playing {
    animation: pulse 2s infinite;
}

.audio-icon {
    font-size: 3em;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}


@keyframes wave {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.play-pause-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #43a047);
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.play-pause-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.play-pause-btn.playing {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.audio-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #4caf50, #43a047);
    border-radius: 3px;
    transition: width 0.1s linear;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid #4caf50;
    border-radius: 50%;
    transform: translate(50%, -25%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.time-display {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

.audio-hint {
    color: #666;
    font-size: 0.9em;
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* Hidden native audio element */
#audioPlayer {
    display: none;
}

/* Audio-specific word display */
.audio-word-display {
    font-size: 1.5em;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    text-align: center;
}

/* Responsive audio player */
@media (max-width: 768px) {
    .audio-visualizer {
        width: 30%;
        height: 50px;
        border-radius: 10px;
        font-size: 10px;
    }

    .audio-icon {
        font-size: 2.5em;
    }

    .audio-controls {
        padding: 12px 20px;
        flex-direction: column;
        gap: 12px;
        border-radius: 25px;
    }

    .audio-progress {
        min-width: 100%;
    }

    .progress-bar {
        height: 5px;
    }
}

/* Дополнительные анимации для аудио */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.audio-visualizer:hover .audio-icon {
    animation: bounce 1s ease;
}

/* Эффект загрузки */
.audio-loading {
    position: relative;
}

.audio-loading::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 3px solid transparent;
    border-top: 3px solid #4caf50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.option-btn {
    padding: 18px;
    background: white;
    color: #49aa4d;
    border: 2px solid #a5d6a7;
    position: relative;
    padding-left: 60px;
    text-align: left;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    border-radius: 10px;
}

.option-btn:hover {
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    border-color: #4caf50;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

/* Key Indicator - только для десктопов */
.key-indicator {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.option-btn:hover .key-indicator {
    background: linear-gradient(135deg, white, #f5f5f5);
    color: #4caf50;
    transform: translateY(-50%) scale(1.1);
}

/* Состояния правильного/неправильного ответа */
.option-btn.correct {
    background: linear-gradient(135deg, #66bb6a, #4caf50);
    color: white;
    border-color: #66bb6a;
}

.option-btn.correct .key-indicator {
    background: linear-gradient(135deg, white, #f5f5f5);
    color: #66bb6a;
}

.option-btn.incorrect {
    background: linear-gradient(135deg, #ff6564c9, #ff5c5c);
    color: white;
    border-color: #ff807f;
}

.option-btn.incorrect .key-indicator {
    background: linear-gradient(135deg, white, #f5f5f5);
    color: #ef5350;
}

/* Keyboard shortcuts hint */
.keyboard-hint {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
    grid-column: 1 / -1;
    /* Растягиваем на все колонки */
}

/* Мобильная версия - убираем индикаторы клавиш */
@media (max-width: 768px) {
    .option-btn {
        text-align: center;
        justify-content: center;
        padding: 13px;
    }

    .audio-hint,
    .keyboard-hint,
    .key-indicator {
        display: none;
    }

    .options-container {
        grid-template-columns: 1fr;
        /* 1 колонка на мобильных */
        gap: 8px;
    }
}

/* Улучшенная версия для больших экранов */
@media (min-width: 1200px) {
    .options-container {
        gap: 20px;
    }

    .option-btn {
        padding: 20px 20px 20px 70px;
        min-height: 80px;
        font-size: 1.1em;
    }

    .key-indicator {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }
}

/* Анимация появления вариантов */
@keyframes optionAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.option-btn:nth-child(1) {
    animation-delay: 0.1s;
}

.option-btn:nth-child(2) {
    animation-delay: 0.2s;
}

.option-btn:nth-child(3) {
    animation-delay: 0.3s;
}

.option-btn:nth-child(4) {
    animation-delay: 0.4s;
}

.option-btn:nth-child(5) {
    animation-delay: 0.5s;
}

.option-btn:nth-child(6) {
    animation-delay: 0.6s;
}

/* Direction hint styles */
.direction-hint {
    font-size: 0.6em;
    color: #666;
    margin-top: 10px;
    font-style: italic;
    font-weight: normal;
    opacity: 0.8;
}

/* Для аудио режимов - своя подсказка */
.audio-hint {
    color: #666;
    font-size: 0.9em;
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* Улучшаем отображение слова с подсказкой */
.word-display {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1b5e20;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

@media (max-width: 768px) {
    .word-display {
        font-size: 36px;
    }

    .direction-hint {
        font-size: 0.5em;
    }

    .training-container {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .word-display {
        font-size: 28px;
    }
}

/* Language direction indicator */
.direction-indicator {
    display: inline-block;
    background: rgba(76, 175, 80, 0.1);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.7em;
    color: #2e7d32;
    margin-left: 10px;
    vertical-align: middle;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

/* Training Header Styles */

.stats-container {
    display: flex;
    align-items: center;
    gap: 25px;
}

.stat-item-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 15px;
    border-radius: 10px;
    border: 1px solid rgba(139, 195, 74, 0.15);
    min-width: 80px;
    transition: all 0.5s ease;
}

.word-count-container:hover,
.timer-container:hover,
.progress-container:hover,
.stat-item-mini:hover,
.stat-item-mini:hover {
    cursor: pointer;
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-label {
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.4em;
    font-weight: bold;
    line-height: 1;
}

.stat-value.correct {
    color: #6baf46;
}

.stat-value.incorrect {
    color: #ef5350;
}

.stat-value.progress {
    color: #6baf46;
}

/* Progress bar for time modes */
.progress-container {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.5s ease;
    border: 1px solid rgba(139, 195, 74, 0.15);
}

.progress-label {
    font-size: 0.8em;
    color: #7a9c5f;
    font-weight: 600;
    white-space: nowrap;
}

.progress-bar-mini {
    width: 120px;
    height: 8px;
    background: #e8f5e9;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill-mini {
    height: 100%;
    background: linear-gradient(135deg, #6baf46, #5a9c3a);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill-mini::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid #6baf46;
    border-radius: 50%;
    transform: translate(50%, -25%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Timer with better styling */
.timer-container {
    display: flex;
    align-items: center;
    transition: all 0.5s ease;
    gap: 15px;
}

.timer {
    font-size: 1.8em;
    font-weight: bold;
    color: #2d5016;
    background: linear-gradient(135deg, #6baf46, #5a9c3a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 8px 16px;
    background-color: rgba(107, 175, 70, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(107, 175, 70, 0.2);
    min-width: 80px;
    text-align: center;
}

.timer-label {
    font-size: 0.8em;
    color: #7a9c5f;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Finish button improvements */
.finish-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #e57373, #ef5350);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.finish-btn:hover {
    background: linear-gradient(135deg, #ef5350, #e53935);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.3);
}

.finish-btn::before {
    content: '⏹';
    font-size: 1.1em;
}

/* Word count for infinite modes */
.word-count-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid rgba(139, 195, 74, 0.15);
    justify-content: center;
    transition: all 0.3s ease;
}

.word-count-icon {
    font-size: 1.2em;
}

.word-count-value {
    font-size: 1.3em;
    font-weight: bold;
}

.word-count-label {
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .training-header {
        padding: 12px 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    .stats-container {
        gap: 15px;
        justify-content: space-around;
        flex-wrap: wrap;
    }

    .stat-item-mini {
        min-width: 70px;
        padding: 6px 12px;
    }

    .stat-value {
        font-size: 1.2em;
    }

    .progress-container {
        padding: 6px 12px;
    }

    .progress-bar-mini {
        width: 100%;
    }

    .timer {
        font-size: 1.5em;
        padding: 6px 12px;
        min-width: 70px;
    }

    .timer-container {
        gap: 10px;
    }

    .finish-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .stats-container {
        gap: 10px;
    }

    .stat-item-mini {
        min-width: 60px;
        padding: 5px 10px;
    }

    .stat-label {
        font-size: 0.7em;
    }

    .stat-value {
        font-size: 1.1em;
    }

    .progress-bar-mini {
        width: 100%;
    }

    .timer {
        font-size: 1.3em;
        width: 100%;
    }
}

/* Leaderboard Page Styles */

.category-header span {
    text-align: center;
}

.category-header span:first-child {
    text-align: left;
}

.category-header span:last-child {
    text-align: right;
}

.leaderboard-items {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    grid-template-columns: 20px 100px 110px 80px 80px 110px;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(139, 195, 74, 0.1);
    transition: all 0.3s ease;
    align-items: center;
    flex-direction: row;
}

.leaderboard-item:last-child {
    grid-template-columns: 20px 100px 110px 80px 80px 110px;
    border-bottom: none;
}


.leaderboard-item .place {
    font-weight: bold;
    font-size: 1.1em;
    color: #2d5016;
}

.leaderboard-item .user {
    font-weight: 500;
    color: #2d5016;
}

.leaderboard-item .mode {
    color: #4a7c1f;
    font-size: 0.9em;
}

.leaderboard-item .time,
.leaderboard-item .words {
    font-weight: bold;
    color: #2d5016;
    text-align: center;
}

.leaderboard-item .accuracy {
    color: #4a7c1f;
    text-align: center;
    font-weight: 500;
}

.leaderboard-item .date {
    color: #7a9c5f;
    font-size: 0.85em;
    text-align: right;
}

/* Места на пьедестале */
.first-place {
    background: linear-gradient(135deg, #fff9e6, #fff0cc);
    border-left: 4px solid #ffd700;
}

.first-place .place {
    color: #ffd700;
    font-size: 1.2em;
}

.second-place {
    background: linear-gradient(135deg, #f8f8f8, #f0f0f0);
    border-left: 4px solid #c0c0c0;
}

.second-place .place {
    color: #c0c0c0;
}

.third-place {
    background: linear-gradient(135deg, #fff4e6, #ffe8cc);
    border-left: 4px solid #cd7f32;
}

.third-place .place {
    color: #cd7f32;
}

/* Состояния */
.loading, .no-data, .error {
    color: #7a9c5f;
    font-style: italic;
}

.error {
    color: #ff0000;
}

/* Leaderboard Info */
.leaderboard-info {
    padding: 25px 0;
    margin-top: 10px;
}

.leaderboard-info h3 {
    margin-bottom: 20px;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    padding: 15px;
    background: rgb(253 254 253);
    border-radius: 8px;
    border-left: 3px solid #6baf46;
}

.info-item strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.info-item p {
    font-size: 0.9em;
    line-height: 1.4;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .category-header {
        /* grid-template-columns: 20px 100px 150px 80px 80px 120px; */
        font-size: 0.8em;
        padding: 12px 15px;
    }

    .category-header span:nth-child(4),
    .category-header span:nth-child(5) {
        display: none;
    }

    .leaderboard-item {
        /* grid-template-columns: 20px 100px 150px 80px 80px 120px; */
        padding: 12px 15px;
        font-size: 0.9em;
    }

    .leaderboard-item .date,
    .leaderboard-item .accuracy {
        display: none;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .leaderboard-section h2 {
        font-size: 1.2em;
    }
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(139, 195, 74, 0.25);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.app-title {
    font-weight: 700;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.app-title::before {
    content: '📚';
    font-size: 1.3em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 15px;
    background: rgba(248, 255, 237, 0.8);
    padding: 8px 16px;
    border-radius: 25px;
    border: 1px solid rgba(139, 195, 74, 0.2);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6baf46, #5a9c3a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9em;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.95em;
}

.user-role {
    font-size: 0.8em;
    margin-top: 2px;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.leaderboard-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ffd54f, #ffb300);
    color: #ffffff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255, 181, 0, 0.2);
}

.leaderboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 181, 0, 0.3);
    background: linear-gradient(135deg, #ffb300, #ff8f00);
}

.grammar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #59bdb7, #1b9d5b);
    color: #ffffff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(34, 198, 116, 0.2);
}

.grammar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(15, 100, 58, 0.2);
    background: linear-gradient(135deg, rgb(64, 138, 133), #189657);
}

.movies-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #64b5f6, #42a5f5);
    color: #5d4037;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255, 181, 0, 0.2);
    color: white;
}

.movies-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 110, 255, 0.3);
    background: linear-gradient(135deg, #4daaf5, #2698f5);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #e57373, #ef5350);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.3);
    background: linear-gradient(135deg, #ef5350, #e53935);
}

/* Responsive Header */
@media (max-width: 768px) {
    header {
        padding: 12px 4%;
    }

    .header-content {
        gap: 5vw;
    }

    .app-title {
        font-size: 1.3em;
        order: 1;
        flex: 1;
    }

    .header-actions {
        order: 3;
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8em;
    }

    .user-name {
        font-size: 0.9em;
    }

    .user-role {
        font-size: 0.75em;
    }

    .leaderboard-btn,
    .logout-btn {
        padding: 8px 16px;
        font-size: 0.85em;
    }
}

@media (max-width: 768px) {

    .app-title::before {
        display: none;
    }

    .grammar-btn span:nth-of-type(2),
    .movies-btn span:nth-of-type(2),
    .leaderboard-btn span:nth-of-type(2),
    .logout-btn span:nth-of-type(2) {
        display: none;
    }

    .grammar-btn,
    .movies-btn,
    .leaderboard-btn,
    .logout-btn {
        padding: 10px;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .user-details {
        display: none;
    }

    .user-profile {
        padding: 6px;
    }

    .header-buttons {
        gap: 8px;
        margin-bottom: 10px;
    }

    .grammar-btn span:nth-of-type(2),
    .movies-btn span:nth-of-type(2),
    .leaderboard-btn span:nth-of-type(2),
    .logout-btn span:nth-of-type(2) {
        display: none;
    }

    .grammar-btn,
    .movies-btn,
    .leaderboard-btn,
    .logout-btn {
        padding: 10px;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Instruction Page Styles */
.instruction-content {
    max-width: 900px;
    margin: 0 auto;
}

.instruction-section h2 {
    color: #2d5016;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.instruction-steps {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 15px;
}


.tips-section,
.dev-install-steps,
.step {
    padding: 20px;
    background: linear-gradient(295deg, #ffffff, #f7f9f4);
    border-radius: 8px;
    border-left: 4px solid #6baf46;
    transition: all 0.5s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.step h3 {
    margin-bottom: 10px;
    font-size: 1.2em;
}

.step p {
    margin-bottom: 15px;
    line-height: 1.5;
}

.instruction-btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6baf46, #5a9c3a);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    width: 100%;
}

.instruction-btn:hover {
    background: linear-gradient(135deg, #5a9c3a, #4a8c2a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 175, 70, 0.3);
}

/* Screenshots */
.screenshots {
    margin-top: 20px;
}

.screenshots h3 {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.screenshot-placeholder {
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    opacity: 0.95;
}

.screenshot-placeholder img {
    height: 100%;
    width: 100%;
    border-radius: 10px;
    box-shadow: 6px 8px 26px -1px rgba(0, 0, 0, 0.75);
    -webkit-box-shadow: 6px 8px 26px -1px rgba(0, 0, 0, 0.75);
    -moz-box-shadow: 6px 8px 26px -1px rgba(0, 0, 0, 0.75);
}

.placeholder-text {
    color: #4a7c1f;
    font-style: italic;
    text-align: center;
}

/* Feature List */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.feature-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(139, 195, 74, 0.2);
}

.feature-list li:last-child {
    border-bottom: none;
}

/* Tips Section */
.tips-section {
    background: linear-gradient(295deg, #ffffff, #f7f9f4);
    border-radius: 8px;
    border-left: 4px solid #6baf46;
    margin: 0 5px;
    padding: 15px;
}

.tips-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.tip-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tip-card h3 {
    margin-bottom: 10px;
    font-size: 1.1em;
}

.tip-card p {
    line-height: 1.5;
    font-size: 0.95em;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e8f5e9;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
}


.close-modal:hover {
    color: #e53935;
}

.modal-body {
    padding: 25px;
}

.extension-info {
    color: #2d5016;
}

.extension-features {
    margin: 20px 0;
}

.extension-features h4 {
    margin-bottom: 10px;
}

.extension-features ul {
    padding-left: 20px;
}

.extension-features li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.availability {
    padding: 15px;
    background: rgba(107, 175, 70, 0.1);
    border-radius: 8px;
    border-left: 4px solid #6baf46;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {

    .tips-section,
    .instruction-section {
        padding: 5px;
        margin: 0 5px;
    }

    .tips-grid {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }

    .step {
        padding: 15px;
    }

    .screenshot-placeholder {
        height: 180px;
    }

    .modal-content {
        width: 95%;
    }
}

.extension-download {
    text-align: center;
    margin-top: 20px;
}

.dev-install-steps {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.config-steps {
    background: linear-gradient(295deg, #ffffff, #f7f9f4);
    border-left-color: #68ac44;
}

.dev-step {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dev-step h4 {
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dev-step p {
    margin: 0;
    line-height: 1.5;
}

.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin: 8px 0;
    overflow-x: auto;
}

.warning-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 12px;
    margin: 15px 0;
    color: #856404;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #69ad45;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

/* Bottom Drawer для всех устройств */
.bottom-drawer {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 20px;
    transition: bottom 0.3s ease-in-out;
    z-index: 1000;
    max-width: 600px;
    margin: 0 auto;
}

.bottom-drawer.open {
    bottom: 0;
}

.drawer-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 0 auto 15px auto;
    cursor: pointer;
}

.drawer-next-btn {
    width: 100%;
    padding: 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.drawer-next-btn:hover {
    background: #45a049;
}

.drawer-next-btn:active {
    transform: scale(0.98);
}

/* Стили для десктопа */
@media (min-width: 769px) {
    .bottom-drawer {
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.2);
    }

    .drawer-handle {
        width: 60px;
        height: 5px;
    }

    .drawer-next-btn {
        padding: 18px;
        font-size: 18px;
        border-radius: 10px;
    }

    /* Скрываем старую кнопку на всех устройствах */
    #nextBtn {
        display: none !important;
    }
}

@media (max-width: 768px) {

    .question-container {
        padding: 20px;
    }

    /* Скрываем старую кнопку на всех устройствах */
    #nextBtn {
        display: none !important;
    }
}

/* Overlay для drawer */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Дополнительная информация в drawer */
.drawer-content {
    text-align: center;
}

.answer-feedback {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
}

.answer-feedback.correct {
    background: #e8f5e8;
    color: #2e7d32;
}

.answer-feedback.incorrect {
    background: #ffebee;
    color: #c62828;
}

.keyboard-hint {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

/* Кнопка открытия меню */
.menu-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 15px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.menu-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.menu-icon {
    font-size: 1.1em;
}

/* Выезжающий drawer - исправленные стили */
.side-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 420px;
    height: 100vh;
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.side-drawer.active {
    right: 0;
    pointer-events: auto;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    pointer-events: none;
}

.side-drawer.active .drawer-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.drawer-content {
    position: relative;
    background: white;
    height: 100%;
    width: 100%;
    z-index: 1001;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
    /* Для плавного скролла на iOS */
}

/* Исправленный header для drawer */
.drawer-header {
    padding: 25px;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

/* Body drawer - исправленное */
.drawer-body {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Для плавного скролла на iOS */
}

.drawer-header h2 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    text-align: center;
}

.drawer-close-btn {
    position: absolute;
    top: 20px;
    right: 10px;
    border: none;
    color: white;
    font-size: 1.8em;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.drawer-close-btn:hover {
    background: #77757545;
    transform: rotate(90deg);
}

/* Body drawer */
.drawer-body {
    flex: 1;
    padding: 0;
    overflow-y: auto;
}

.drawer-section {
    padding: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.drawer-section:last-child {
    border-bottom: none;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #2d5016;
}

.section-icon {
    font-size: 1.1em;
}

.settings-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    color: #333;
    font-size: 0.95em;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.settings-hint {
    font-size: 0.85em;
    line-height: 1.4;
}

.settings-features {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e0e7ff;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-icon {
    font-size: 1em;
    flex-shrink: 0;
    margin-top: 2px;
    color: #667eea;
}

.feature-text {
    font-size: 0.9em;
    line-height: 1.4;
}

/* Компактные карточки импорта */
.import-cards-compact {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.import-card-compact {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.import-card-compact:hover {
    border-color: #a5d6a7;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(93, 216, 126, 0.1);
}

.import-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.import-card-header .import-icon {
    font-size: 1.4em;
}

.import-card-header h4 {
    margin: 0;
    font-size: 1.1em;
}

.import-description {
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 15px;
}

.import-btn-compact {
    display: inline-block;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.import-btn-compact:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* Быстрая статистика в drawer */
.quick-stats-drawer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.quick-stat-item {
    text-align: center;
    padding: 15px 10px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 1px solid #e0e7ff;
}

.quick-stat-item .stat-value {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 5px;
}

.quick-stat-item .stat-label {
    font-size: 0.8em;
    font-weight: 500;
}

/* Адаптивность с исправлениями */
@media (max-width: 768px) {
    .side-drawer {
        width: 100vw;
        right: -100vw;
    }

    .side-drawer.active {
        right: 0;
    }

    .drawer-content {
        width: 100%;
        max-width: 100%;
    }

    .drawer-content {
        overflow: hidden;
    }

    .drawer-body {
        height: calc(100vh - 80px);
        /* Высота минус header */
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }

    /* Фикс для скролла на мобильных */
    .drawer-body::-webkit-scrollbar {
        display: none;
    }

    .menu-toggle-btn .menu-text {
        display: none;
    }

    .menu-toggle-btn {
        padding: 10px;
        margin-right: 10px;
    }

    .quick-stats-drawer {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .drawer-header {
        padding: 20px;
        min-height: 60px;
    }

    .drawer-section {
        padding: 20px;
    }

    .import-card-compact {
        padding: 15px;
    }

    /* Фикс для мелких экранов */
    .drawer-body {
        height: calc(100vh - 60px);
    }
}



.integration-steps {
    margin: 20px 0;
}

.benefits {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
}

.benefits h5 {
    margin-bottom: 10px;
    font-size: 1.1em;
}

.benefits ul {
    list-style-type: none;
    padding-left: 0;
}

.benefits li {
    margin-bottom: 8px;
    position: relative;
}

.demo-info {
    text-align: center;
    cursor: pointer;
}


.mobile-app-section .section-title {
    margin-bottom: 15px;
}

.mobile-app-promo {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-app-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-app-icon {
    font-size: 32px;
    background: #e9ecef;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-app-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
}

.mobile-app-description {
    margin: 0;
    font-size: 14px;
}

/* Кнопка скачивания APK */
.android-download-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    border: none;
    cursor: pointer;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.android-download-btn:hover {
    background: linear-gradient(135deg, #43a047, #388e3c);
    transform: translateY(-2px);
}

.android-icon {
    font-size: 20px;
}

.btn-text {
    flex-grow: 1;
    font-size: 15px;
}

.download-icon {
    font-size: 18px;
}