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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.lang-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.lang-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.3);
}

.lang-btn.active {
    background: white;
    color: #667eea;
}

.mode-selector {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.mode-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    color: #667eea;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

.mode-btn.active {
    background: white;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.mode-section {
    display: none;
}

.mode-section.active {
    display: block;
}

.converter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.converter-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.converter-card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.result {
    font-size: 2rem;
    color: #764ba2;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reference-table {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.reference-table h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.reference-table table {
    width: 100%;
}

.reference-table td {
    padding: 10px;
    text-align: center;
    font-size: 1.1rem;
    color: #555;
}

.learning-container {
    max-width: 600px;
    margin: 0 auto;
}

.score-board {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
}

.quiz-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

#quiz-question {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.5rem;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.quiz-option {
    background: #f5f5f5;
    border: 2px solid transparent;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.quiz-option:hover:not(:disabled) {
    background: #e8e8e8;
    transform: translateY(-2px);
}

.quiz-option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.quiz-option.correct {
    background: #4caf50;
    color: white;
    border-color: #45a049;
}

.quiz-option.incorrect {
    background: #f44336;
    color: white;
    border-color: #da190b;
}

.feedback {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    min-height: 30px;
}

.feedback.correct {
    color: #4caf50;
}

.feedback.incorrect {
    color: #f44336;
}

.next-btn {
    display: none;
    width: 100%;
    background: #667eea;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.next-btn:hover {
    background: #5a67d8;
}

.difficulty-selector {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.difficulty-selector label {
    font-weight: 600;
    margin-right: 10px;
    color: #667eea;
}

.difficulty-selector select {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}

footer {
    text-align: center;
    margin-top: 50px;
    color: white;
    opacity: 0.8;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .mode-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .mode-btn {
        width: 200px;
    }
    
    .quiz-options {
        grid-template-columns: 1fr;
    }
}