/* Fraction Master CSS */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.nav-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.home-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.game-title {
    margin: 0;
    font-size: 2em;
    color: #667eea;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.game-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
}

.level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.level-display, .score-display, .streak-display {
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
}

.level-description {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 25px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.1em;
    margin-bottom: 20px;
    color: #555;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.progress-container {
    position: relative;
    background: rgba(255, 255, 255, 0.3);
    height: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #48bb78, #38a169);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.game-area {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    text-align: center;
}

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

.question-text {
    font-size: 1.4em;
    margin-bottom: 20px;
    color: #555;
    font-weight: 500;
}

.fraction-display {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0;
    font-family: 'Times New Roman', serif;
}

.fraction-display .fraction {
    display: inline-block;
    text-align: center;
    vertical-align: middle;
}

.fraction-display .numerator {
    display: block;
    border-bottom: 3px solid #667eea;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.fraction-display .denominator {
    display: block;
    padding-top: 5px;
}

.answer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.fraction-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.fraction-input input {
    width: 80px;
    padding: 10px;
    font-size: 1.5em;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease;
}

.fraction-input input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.fraction-line {
    width: 80px;
    height: 3px;
    background: #667eea;
    margin: 2px 0;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.visual-container {
    margin: 30px 0;
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fraction-visual {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    max-width: 400px;
}

.visual-part {
    width: 30px;
    height: 30px;
    border: 2px solid #667eea;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.visual-part.filled {
    background-color: #667eea;
}

.visual-part.unfilled {
    background-color: rgba(102, 126, 234, 0.1);
}

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

.control-btn {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.hint-display {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid #ffc107;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    color: #856404;
    font-weight: 500;
}

.feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.feedback.correct {
    background: rgba(72, 187, 120, 0.1);
    color: #2f855a;
    border: 2px solid #48bb78;
}

.feedback.incorrect {
    background: rgba(245, 101, 101, 0.1);
    color: #c53030;
    border: 2px solid #f56565;
}

.feedback.neutral {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 2px solid #667eea;
}

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

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.modal-content h3 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 20px;
}

.level-stats, .final-stats {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 1.1em;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.modal-btn:not(.primary) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 2px solid #667eea;
}

.modal-btn:not(.primary):hover {
    background: #667eea;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-header {
        padding: 10px 20px;
        flex-direction: column;
        gap: 10px;
    }

    .game-title {
        font-size: 1.5em;
    }

    .level-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .game-area {
        padding: 20px;
    }

    .fraction-display {
        font-size: 2.5em;
    }

    .answer-container {
        flex-direction: column;
        gap: 15px;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }

    .control-btn {
        width: 200px;
    }

    .modal-content {
        padding: 20px;
        margin: 20px;
    }

    .modal-buttons {
        flex-direction: column;
        align-items: center;
    }

    .modal-btn {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 0 10px;
    }

    .fraction-display {
        font-size: 2em;
    }

    .fraction-input input {
        width: 60px;
        font-size: 1.2em;
    }

    .fraction-line {
        width: 60px;
    }

    .visual-part {
        width: 25px;
        height: 25px;
    }
}

/* Animation Classes */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.bounce {
    animation: bounce 0.6s ease-in-out;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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