/**
 * English Vocabulary Learning Application - Styles
 */

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.nav a:hover {
    opacity: 0.8;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    font-weight: 500;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.95;
}

/* Tutorial Section */
.tutorial-section {
    padding: 4rem 0;
    background-color: var(--card-bg);
}

.tutorial-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.video-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.video-description h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.video-description ul {
    list-style: none;
    margin: 1.5rem 0;
}

.video-description ul li {
    padding: 0.5rem 0;
    font-size: 1rem;
    color: var(--text-light);
}

.video-description .note {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #fef3c7;
    border-left: 4px solid var(--warning-color);
    border-radius: 4px;
    font-size: 0.95rem;
}

/* Practice Section */
.practice-section {
    padding: 4rem 0;
    background-color: var(--bg-color);
}

.practice-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

/* Settings Panel */
.settings-panel {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
}

.setting-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

.setting-group select,
.setting-group input[type="number"] {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

#start-practice {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
}

/* Radio Group Styling */
.radio-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.6rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: white;
    font-size: 0.9rem;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

.radio-label input[type="radio"] {
    margin-right: 0.5rem;
    cursor: pointer;
    width: auto;
    padding: 0;
    border: none;
}

.radio-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--primary-color);
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .settings-panel {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .settings-panel {
        grid-template-columns: 1fr;
    }
    
    .radio-label {
        min-width: 100px;
    }
}

}

.setting-group select:focus,
.setting-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-secondary {
    background-color: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Practice Area */
.practice-area {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* Progress Bar */
.progress-bar {
    position: relative;
    height: 30px;
    background-color: var(--border-color);
    border-radius: 15px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--success-color) 100%);
    border-radius: 15px;
    transition: width 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: var(--text-color);
}

/* Word Card */
.word-card {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.word-category,
.word-difficulty {
    display: inline-block;
    margin: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.word-card h3 {
    font-size: 1.25rem;
    margin: 2rem 0 1rem;
    color: var(--text-light);
}

.english-word {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 2rem 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.answer-section {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.answer-section input {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.25rem;
    text-align: center;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.answer-section input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.answer-section input:disabled {
    background-color: var(--bg-color);
    cursor: not-allowed;
}

/* Feedback */
.feedback {
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback.correct {
    background-color: #d1fae5;
    border-left: 4px solid var(--success-color);
}

.feedback.incorrect {
    background-color: #fee2e2;
    border-left: 4px solid var(--error-color);
}

.feedback-icon {
    font-size: 2rem;
}

.feedback-text {
    text-align: left;
}

.feedback-text strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Word Stats */
.word-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 8px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Results Section */
.results-section {
    background: var(--card-bg);
    padding: 3rem 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    margin-top: 2rem;
}

.results-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.result-card {
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    box-shadow: var(--shadow-lg);
}

.result-value {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.result-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Statistics Section */
.stats-section {
    padding: 4rem 0;
    background-color: var(--card-bg);
}

.stats-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.stats-content {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.stats-message {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-title {
    font-size: 1rem;
    color: var(--text-light);
}

.stats-content h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

.recent-words {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-word-item {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.word-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.category-tag {
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
}

.mastered-badge {
    padding: 0.25rem 0.75rem;
    background-color: var(--success-color);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
}

.word-progress {
    font-weight: 500;
    color: var(--text-light);
}

/* Footer */
.footer {
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer p {
    margin: 0.5rem 0;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .nav {
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .video-container {
        grid-template-columns: 1fr;
    }
    
    .settings-panel {
        grid-template-columns: 1fr;
    }
    
    .english-word {
        font-size: 2rem;
    }
    
    .word-stats {
        grid-template-columns: 1fr;
    }
    
    .results-stats {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .english-word {
        font-size: 1.75rem;
    }
}
