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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

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

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

.progress-bar {
    background: rgba(255,255,255,0.3);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    max-width: 400px;
    margin: 0 auto;
}

.progress {
    background: #4CAF50;
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

/* Category Selection */
.category-selection {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.category-selection h2 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
}

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

.category-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease forwards;
    opacity: 0;
}

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #8e44ad, #3498db, #2ecc71);
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.category-card:hover .card-icon {
    transform: rotate(360deg);
}

.card-icon i {
    font-size: 2.5rem;
    color: white;
}

.category-card h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 15px;
}

.category-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
}

.progress-indicator span {
    color: #888;
    font-size: 0.9rem;
}

.mini-progress {
    flex: 1;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-right: 15px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s ease;
}

/* Learning Screen */
.learning-screen {
    animation: fadeIn 0.5s ease;
}

.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.back-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.progress-circles {
    display: flex;
    gap: 10px;
}

.circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s ease;
}

.circle.completed {
    background: #4CAF50;
    transform: scale(1.2);
}

.circle.current {
    background: #2196F3;
    animation: pulse 1.5s infinite;
}

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

.hearts {
    color: #e74c3c;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.lesson-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.question {
    text-align: center;
    width: 100%;
}

.question h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #333;
    animation: fadeIn 0.6s ease;
}

.sign-demo {
    width: 200px;
    height: 200px;
    background: #f8f9fa;
    border: 3px dashed #ddd;
    border-radius: 15px;
    margin: 20px auto 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: bounceIn 0.8s ease;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.sign-demo:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.05);
}

.sign-demo:active {
    transform: scale(0.95);
}

.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    margin-top: 30px;
}

.option {
    background: #f8f9fa;
    border: 3px solid #ddd;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.option:hover::before {
    left: 100%;
}

.option:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.option.selected {
    border-color: #2196F3;
    background: #e3f2fd;
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(33,150,243,0.3);
}

.option.correct {
    border-color: #4CAF50;
    background: #e8f5e8;
    color: #2e7d32;
    animation: correctAnswer 0.6s ease;
}

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

.option.wrong {
    border-color: #f44336;
    background: #ffebee;
    color: #c62828;
    animation: wrongAnswer 0.6s ease;
}

@keyframes wrongAnswer {
    0% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
    100% { transform: translateX(0); }
}

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

.lesson-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.check-btn, .continue-btn, .continue-lesson-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    position: relative;
    overflow: hidden;
}

.check-btn::before, .continue-btn::before, .continue-lesson-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.check-btn:hover::before, .continue-btn:hover::before, .continue-lesson-btn:hover::before {
    width: 300px;
    height: 300px;
}

.check-btn:hover, .continue-btn:hover, .continue-lesson-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.check-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.check-btn:disabled:hover {
    background: #ccc;
}

/* Result Screen */
.result-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    animation: fadeIn 0.5s ease;
}

.result-content {
    background: white;
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 100%;
    animation: zoomIn 0.6s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.result-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #333;
}

.result-content p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 40px;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 5px;
    animation: countUp 1s ease;
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .categories {
        grid-template-columns: 1fr;
    }
    
    .level-buttons {
        grid-template-columns: 1fr;
    }
    
    .options {
        grid-template-columns: 1fr;
    }
    
    .lesson-header {
        padding: 15px;
    }
    
    .lesson-content {
        padding: 20px;
    }
    
    .sign-demo {
        width: 150px;
        height: 150px;
        font-size: 3rem;
    }
    
    .option {
        padding: 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .question h3 {
        font-size: 1.5rem;
    }
    
    .result-content {
        padding: 30px 20px;
    }
}