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

body {
    font-family: 'Noto Sans', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    direction: rtl;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

.screen {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.screen.active {
    display: block;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.menu-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 10px;
    cursor: pointer;
    width: 250px;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.progress {
    margin-bottom: 30px;
    text-align: center;
}

.progress-bar {
    background: #ecf0f1;
    height: 10px;
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    background: #3498db;
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.question-container {
    text-align: center;
    margin-bottom: 30px;
}

.question-container h2 {
    font-size: 4.5em;
    color: #2c3e50;
    margin-bottom: 30px;
}

.input-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

#answer-input {
    padding: 20px;
    font-size: 2.5em;
    text-align: center;
    border: 2px solid #bdc3c7;
    border-radius: 10px;
    width: 200px;
    direction: ltr;
}

#answer-input:focus {
    outline: none;
    border-color: #3498db;
}

#voice-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2em;
    transition: background 0.3s ease;
}

#voice-btn:hover {
    background: #c0392b;
}

#voice-btn.listening {
    background: #27ae60;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#submit-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#submit-btn:hover {
    background: #229954;
}

.feedback {
    margin-top: 20px;
    font-size: 1.3em;
    font-weight: bold;
    min-height: 30px;
}

.feedback.correct {
    color: #27ae60;
}

.feedback.incorrect {
    color: #e74c3c;
}

.memorization-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.memorization-controls button {
    background: #9b59b6;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.memorization-controls button:hover {
    background: #8e44ad;
}

.current-equation {
    text-align: center;
    margin: 30px 0;
}

.current-equation h2 {
    font-size: 4.5em;
    color: #2c3e50;
}

.reading-progress {
    text-align: center;
    margin-top: 30px;
    font-size: 1.1em;
    color: #7f8c8d;
}

.table-container {
    margin-top: 20px;
}

.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.table-item {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.3em;
    color: #2c3e50;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.table-item:hover {
    border-color: #3498db;
    background: #d5dbdb;
}

.back-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: #7f8c8d;
}

#results-screen h2 {
    text-align: center;
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 30px;
}

.results-summary {
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 30px;
}

.results-summary p {
    margin-bottom: 15px;
    color: #34495e;
}

.results-summary span {
    font-weight: bold;
    color: #3498db;
}

#results-details {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}

.results-list {
    flex: 1;
    min-width: 250px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #eee;
}

.results-list h3 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.results-list ul {
    list-style: none;
    padding: 0;
}

.results-list li {
    padding: 8px;
    border-bottom: 1px solid #ddd;
    font-size: 1.1em;
}
.results-list li:last-child {
    border-bottom: none;
}

.results-list#correct-details h3 {
    color: #27ae60;
}

.results-list#incorrect-details h3 {
    color: #e74c3c;
}

.results-list .user-answer.incorrect-ans {
    color: #e74c3c;
    text-decoration: line-through;
}

.results-list .correct-ans-text {
    color: #27ae60;
    font-weight: bold;
    margin-right: 5px;
}

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.results-actions .back-btn {
    margin-top: 10px;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .question-container h2 {
        font-size: 3em;
    }
    
    .current-equation h2 {
        font-size: 2em;
    }
    
    .menu-btn {
        width: 100%;
    }
    
    .table-grid {
        grid-template-columns: 1fr;
    }
}