:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f6f7;
    --text-color: #333;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --border-radius: 4px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    color: var(--text-color);
    background-color: #f0f2f5;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
}

h1 {
    margin: 0;
    color: var(--primary-color);
}

nav button {
    margin-left: 10px;
    padding: 8px 12px;
    cursor: pointer;
    background: white;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    color: var(--primary-color);
}

nav button:hover {
    background: var(--primary-color);
    color: white;
}

.hidden {
    display: none !important;
}

section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
}

button {
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.primary-btn {
    background-color: var(--success-color); /* Make primary action green/distinct */
    font-weight: bold;
}

.secondary-btn {
    background-color: #6c757d;
}

.danger-btn {
    background-color: var(--error-color);
}

.text-btn {
    background: none;
    color: #666;
    padding: 5px 0;
    border: none;
    text-align: left;
    margin-bottom: 15px;
    width: auto;
    display: inline-block;
}

.text-btn:hover {
    color: var(--primary-color);
    background: none;
    text-decoration: underline;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex-grow: 1;
}

/* Landing Page Styles */
#landing-page .hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(to bottom, #e3f2fd, #fff);
    border-radius: 8px;
    margin-bottom: 30px;
}

#landing-page h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

#landing-page .subtitle {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 30px;
}

.landing-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.landing-actions button {
    font-size: 1.1em;
    padding: 12px 30px;
}

#landing-page .features, 
#landing-page .how-it-works {
    margin-bottom: 30px;
    padding: 0 20px;
}

#landing-page h3 {
    font-size: 1.5em;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.feature-list, .steps-list {
    line-height: 1.6;
    color: #444;
}

.feature-list li, .steps-list li {
    margin-bottom: 10px;
    font-size: 1.05em;
}

.cta-bottom {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

.cta-bottom h3 {
    margin-bottom: 20px;
}

footer {
    text-align: center;
    padding: 30px 20px;
    color: #888;
    font-size: 0.9em;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

/* Bulk Add Styles */
#bulk-add-container {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
}

#bulk-add-container h3 {
    margin-top: 0;
    font-size: 1.1em;
}

.level-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.level-btn {
    background-color: #6c757d;
    padding: 8px 16px;
}

.level-btn:hover {
    background-color: #5a6268;
}

.result-item, .word-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item:last-child, .word-item:last-child {
    border-bottom: none;
}

.word-info {
    flex-grow: 1;
    cursor: pointer; /* Indicate clickability */
}

.word-info:hover {
    background-color: #f9f9f9;
}

.result-item.selected {
    background-color: #e3f2fd;
    border-left: 4px solid var(--primary-color);
}

.word-header {
    font-size: 1.2em;
    margin-bottom: 5px;
}

.word-details {
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #666;
}

.word-stats {
    font-size: 0.85em;
    color: #555;
    display: flex;
    gap: 10px;
}

.tag {
    background: #eef;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 5px;
}

.tag.level {
    background: #e0f7fa;
    color: #006064;
}

.learned-badge {
    background: var(--success-color);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
}

.delete-word-btn {
    background-color: var(--error-color);
    padding: 6px 12px;
    margin-left: 10px;
    font-size: 0.9em;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 4px;
    color: white;
    z-index: 1000;
}

.toast.success { background-color: var(--success-color); }
.toast.error { background-color: var(--error-color); }

/* Lesson Styles */
.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.lesson-header h2 {
    margin: 0;
}

#lesson-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

#lesson-answer-input {
    font-size: 1.1em;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
}

.lesson-word-display {
    font-size: 2em;
    margin: 10px 0 20px 0;
    text-align: center;
    color: var(--primary-color);
}

#lesson-feedback {
    text-align: center;
    font-size: 1.2em;
    margin: 15px 0;
    padding: 15px;
    border-radius: var(--border-radius);
}

#lesson-feedback.correct {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#lesson-feedback.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.correct-text { color: var(--success-color); font-weight: bold; }
.incorrect-text { color: var(--error-color); font-weight: bold; }

/* Existing pagination styles */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.pagination-controls button {
    padding: 5px 15px;
    font-size: 0.9em;
}

#edit-profile-form-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

#edit-profile-form-container input {
    width: 100%;
    box-sizing: border-box;
}

#cancel-edit-btn {
    background-color: #95a5a6;
}

/* Progress Stats Styles */
.progress-stats-container {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.overall-progress {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
}

.level-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.progress-item {
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

#cancel-modal-btn {
    background-color: #95a5a6;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
    margin-top: 20px;
}

.empty-state p {
    color: #6c757d;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.empty-state button {
    font-weight: bold;
}

/* Word Full Details in Lesson */
.word-full-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0,0,0,0.1);
    text-align: left;
}

.word-full-details .main-word {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--text-color);
}

.word-full-details .main-word .transcription {
    font-size: 0.7em;
    color: #666;
    font-weight: normal;
    margin-left: 5px;
}

.word-full-details .translation {
    font-size: 1.2em;
    margin: 5px 0;
    color: var(--primary-color);
}

.word-full-details .other-info {
    margin: 10px 0;
}

.word-full-details .synonyms {
    font-size: 0.9em;
    color: #555;
    margin: 8px 0;
}

.word-full-details .verb-forms {
    font-size: 0.85em;
    background: rgba(0,0,0,0.03);
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}