@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    width: 90%;
    max-width: 600px;
    text-align: center;
}

.hidden {
    display: none;
}

h1 {
    color: #1a73e8;
    margin-bottom: 20px;
}

.card {
    background-color: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 20px 0;
}

/* Màn hình chọn Level */
.level-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.level-grid .level-btn#summary-mode-btn {
    grid-column: 1 / -1; /* span both columns */
    max-width: 320px;
    margin: 0 auto;
}

.level-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-btn {
    background-color: #fff;
    color: #1a73e8;
    border: 2px solid #1a73e8;
    padding: 25px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.5em;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.level-btn:hover {
    background-color: #1a73e8;
    color: #fff;
    transform: translateY(-5px);
}

/* Phần đáp án */
#answer-section {
    background-color: #e8f0fe;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}
#sentence-text {
    font-size: 1.3em;
    font-weight: bold;
    color: #202124;
    margin: 0;
}
#ipa-text {
    font-size: 1.1em;
    color: #5f6368;
    margin-top: 5px;
    font-weight: normal;
}

/* Nút AI Helper */
.ai-btn {
    background-color: #8E44AD;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.2s ease;
    width: 100%;
    margin-top: 15px;
}

.ai-btn:hover {
    background-color: #71368A;
}

#ai-explanation {
    background-color: #f3e5f5;
    border-left: 4px solid #8E44AD;
    padding: 15px;
    margin-top: 15px;
    border-radius: 0 8px 8px 0;
    text-align: left;
    font-size: 0.95em;
    line-height: 1.5;
}

.sentence-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.icon-btn {
    background: none;
    border: 2px solid #1a73e8;
    color: #1a73e8;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
}
.icon-btn:hover {
    background-color: #1a73e8;
    color: #fff;
}

.practice-section h2 {
    font-size: 1.2em;
    color: #5f6368;
    margin-bottom: 15px;
    text-align: left;
}

.main-btn, .nav-btn, .skip-btn {
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.2s ease;
    width: 100%;
    margin-top: 10px;
}

.main-btn { background-color: #1a73e8; }
.main-btn:hover { background-color: #1558b3; }
.skip-btn { background-color: #f4b400; }
.skip-btn:hover { background-color: #c89200; }
.nav-btn { background-color: #34a853; }
.nav-btn:hover { background-color: #2a8642; }

.nav-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#record-btn.recording { background-color: #d93025; }
#record-btn.recording:hover { background-color: #a50e0e; }
#back-to-levels-btn { background-color: #7f8c8d; }
#back-to-levels-btn:hover { background-color: #616a6b; }


textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1em;
    margin-bottom: 10px;
}

.pronunciation-result, .translation-result {
    text-align: left;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    min-height: 50px;
}

.action-buttons { margin-top: 20px; }
.progress-container { margin-top: 20px; font-size: 1.1em; font-weight: bold; }
.navigation { display: flex; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; gap: 10px; }
.navigation .nav-btn { width: calc(50% - 5px); }
#back-to-levels-btn { width: 100%; }