* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.container {
    text-align: center;
    max-width: 800px;
    width: 90%;
    padding: 2rem;
}

@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding-top: 1rem;
    }

    .container {
        width: 95%;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        align-items: flex-start;
        padding-top: 0.5rem;
    }

    .container {
        width: 100%;
        padding: 0.5rem;
    }
}

.loading {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.mode-selection,
.topic-selection {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.15);
    min-height: 400px;
}

.mode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.mode-selection h2,
.topic-selection h2 {
    color: #667eea;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.mode-header h2 {
    margin-bottom: 0;
}

.mode-buttons,
.topic-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.reset-progress-btn {
    background: transparent;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    align-self: center;
}

.reset-progress-btn:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.repeat-hard-btn {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    align-self: center;
}

.repeat-hard-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.repeat-hard-btn #hard-phrases-count {
    font-weight: 700;
    margin-left: 0.25rem;
}

.mode-btn-container,
.topic-btn-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mode-btn,
.topic-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    flex: 1;
}

.mode-btn:hover,
.topic-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.mode-name {
    font-size: 1.2rem;
}

.mode-progress {
    font-size: 0.9rem;
    opacity: 0.9;
}

.topic-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.topic-name {
    font-size: 1.1rem;
}

.topic-count {
    font-size: 0.9rem;
    opacity: 0.9;
}

.reset-mode-btn,
.reset-topic-btn {
    background: transparent;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.reset-mode-btn:hover,
.reset-topic-btn:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.progress-status {
    font-weight: 600;
}

.progress-status.not-learned {
    color: #e91e63; /* Rose color */
}

.progress-status.in-progress {
    color: #ff9800; /* Orange color */
}

.progress-status.done {
    color: #4caf50; /* Green color */
}

.back-btn {
    background: #e0e0e0;
    color: #555;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.back-btn:hover {
    background: #d0d0d0;
    transform: translateX(-3px);
}

.back-btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.app {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.15);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.header .back-btn {
    margin-bottom: 0;
}

.completion {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.progress {
    background: rgba(102, 126, 234, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    gap: 2rem;
}

.word-container,
.phrase-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.phrase-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    gap: 1rem;
}

.word-display {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
    line-height: 1.2;
    opacity: 1;
    transform: translateY(0);
    display: inline-block;
}

.phrase-display {
    font-size: 1.5rem;
    color: #555;
    line-height: 1.6;
    text-align: center;
    max-width: 600px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.copy-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.1);
}

.play-btn {
    background: white;
    border: none;
    color: #667eea;
    font-size: 1.5rem;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.play-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.save-hard-btn {
    background: transparent;
    border: 2px solid #ff9800;
    color: #ff9800;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    white-space: nowrap;
}

.save-hard-btn:hover {
    background: #ff9800;
    color: white;
    transform: scale(1.05);
}

.now-ok-btn {
    background: transparent;
    border: 2px solid #4caf50;
    color: #4caf50;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    white-space: nowrap;
}

.now-ok-btn:hover {
    background: #4caf50;
    color: white;
    transform: scale(1.05);
}

.word-display.hidden {
    opacity: 0;
    transform: translateY(-10px);
}

.phrase-display.hidden {
    opacity: 0;
    transform: translateY(10px);
}

.instructions {
    margin-top: 2rem;
    color: #666;
    font-size: 0.9rem;
}

.instructions strong {
    background: #667eea;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.mobile-instructions {
    display: none;
}

.mobile-only {
    display: none;
}

.mobile-copy-word {
    display: none;
}

.desktop-copy-word {
    display: flex;
}

.back-phrase-btn {
    background: #e0e0e0;
    color: #555;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    width: 100%;
}

.back-phrase-btn:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
}

.restart-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.hidden {
    display: none !important;
}

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-content h2 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.login-content p {
    color: #666;
    margin-bottom: 2rem;
}

.google-login-btn {
    background: white;
    color: #333;
    border: 1px solid #dadce0;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 auto;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.google-login-btn:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.login-error {
    margin-top: 1rem;
    color: #e74c3c;
    font-size: 0.9rem;
}

.logout-btn {
    background: transparent;
    color: #666;
    border: 1px solid #999;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    border-color: #777;
    color: #555;
    transform: translateY(-1px);
}

.header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.header .back-btn {
    margin-bottom: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .word-display {
        font-size: 1.8rem;
    }

    .phrase-display {
        font-size: 1.8rem;
    }

    .copy-btn {
        font-size: 1rem;
        padding: 0.4rem;
        min-width: 35px;
        height: 35px;
    }

    .play-btn {
        font-size: 1.8rem;
        padding: 0.9rem;
        min-width: 64px;
        height: 64px;
    }

    .app,
    .mode-selection,
    .topic-selection {
        padding: 1.5rem;
        border-radius: 15px;
    }

    .mode-selection h2,
    .topic-selection h2 {
        font-size: 1.5rem;
    }

    .mode-btn,
    .topic-btn {
        padding: 1.2rem 1.5rem;
        font-size: 1rem;
    }

    .reset-progress-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .desktop-instructions {
        display: none;
    }

    .mobile-instructions {
        display: block;
    }

    .mobile-only {
        display: block;
    }

    .mobile-copy-word {
        display: flex;
    }

    .desktop-copy-word {
        display: none !important;
    }

}

@media (max-width: 480px) {
    .word-display {
        font-size: 1.5rem;
    }

    .phrase-display {
        font-size: 1.5rem;
    }

    .word-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
    }

    .word-display {
        display: inline-block;
    }

    .phrase-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
    }

    .copy-btn {
        font-size: 0.9rem;
        padding: 0.3rem;
        min-width: 30px;
        height: 30px;
    }

    .play-btn {
        font-size: 2rem;
        padding: 1rem;
        min-width: 72px;
        height: 72px;
    }

    .reset-mode-btn,
    .reset-topic-btn {
        min-width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }

    .mode-selection h2,
    .topic-selection h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .mode-btn,
    .topic-btn {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .back-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Session Expired Modal */
.session-expired-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.session-expired-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.session-expired-content h2 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.session-expired-content p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.5;
}

.session-expired-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.session-expired-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

