/*cleancss -o public/assets/css/style.min.css public/assets/css/style_original.css */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@700&display=swap');

body {
    background: linear-gradient(to right, #ffcc00, #ff6600);
    padding-top: 60px; /* Adjust for fixed navbar */
}
.navbar {
    background-color: #28a745 !important; /* Green navbar */
}
.navbar-brand, .nav-link {
    font-weight: bold;
    color: #fff !important;
}
.navbar-brand{
    font-family: 'Caveat', cursive;
    color: #000000 !important; /* Soft chalk yellow */
}
.navbar-nav .nav-item {
    margin-right: 15px;
}
.navbar-nav .nav-link:hover {
    text-decoration: underline;
}
.container {
    padding: 20px 0;
}
@media (max-width: 768px) {
    .navbar .container {
        padding: 20px 15px; /* Adds space on smaller screens */
    }
    /* If .d-flex is a direct sibling of .container, remove side padding */
    .container .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .blackboard{
        width: 100%; /* Almost full-screen width */
        max-width: 500px; /* Prevents excessive width */
        margin: 10px auto; /* Centers it */
        padding: 20px;
        min-height: 60vh; /* Ensures app-like height */
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* Ensure they stack vertically */
    .mobile-stack {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
}

.math-lab-title {
    font-family: 'Caveat', cursive;
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    color: #fffbd6; /* Soft chalk yellow */
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.8); /* Chalkboard shadow effect */
    background: linear-gradient(to right, #ffcc00, #ff6600); /* Warm gradient */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    padding: 10px 20px;
    border-radius: 10px;
    animation: bounce 1.5s infinite ease-in-out;
}

/* Bouncing effect */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.browser-recommendation {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: black;
    margin-bottom: 10px;
    padding: 10px;
    border-top: 2px solid #ccc;
    border-bottom: 2px solid #ccc;
}

.browser-recommendation i {
    font-size: 1.5rem;
    margin-right: 8px;
    color: #2e532e
}

.blackboard {
    background-color: #2e532e; /* Dark green like a blackboard */
    color: black; /* Black text */
    border-radius: 12px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    border: 8px solid #7a5230;
    font-family: 'Caveat', cursive;
    margin-top:20px;
    padding: 20px;
}

.blackboard h1, 
.blackboard p, 
.blackboard button {
    /*color: black !important;*/
    color: #fffbd6; /* Soft chalk yellow */
}

.blackboard h1 {
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 1); /* Sharper shadow */
}


.blackboard input {
    background: transparent;
    border: 2px solid black;
    color: black;
    text-align: center;
    font-size: 1.5rem;
}

/* Microphone button: Chalk effect */
.blackboard .btn-primary {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
}

/* Hover effect for buttons */
.blackboard .btn-primary:hover, 
.blackboard .btn-success:hover {
    background: white;
    color: #2e532e; /* Chalk color invert */
}

.math-image {
    width: 100%;
    max-width: 100%; /* Prevents horizontal stretching */
    height: auto; /* Maintains aspect ratio */
    max-height: 400px; /* Limits height on desktop */
    object-fit: contain; /* Ensures it doesn’t stretch */
}

/* Adjust for smaller screens */
@media (max-width: 768px) {
    .math-image {
        max-height: 250px; /* Smaller height on mobile */
    }
}


.operation-card {
    width: 100%;
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    background-color: #f8f9fa;
    border-radius: 12px;
    transition: transform 0.2s, background 0.2s;
}

.operation-card:hover {
    transform: scale(1.1);
    background-color: #ffc107;
    color: white;
}

.operation-symbol{
    font-size: 40px;
    font-weight: bold;
     margin-bottom: 5px;
}

.operation-type {
    display: inline-flex; /* Allows inline behavior but supports flexbox centering */
    align-items: center; /* Centers text vertically */
    justify-content: center; /* Centers text horizontally */
    width: 40px; /* Equal width & height for a perfect circle */
    height: 40px;
    padding: 5px;
    border-radius: 50%; /* Ensures round shape */
    background: #c74545 !important;
    color: #fff;
    font-weight: bold;
    text-align: center;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.quiz-form-wrapper {
    background-color: #2e532e;
    color: black;
    padding: 20px;
    border-radius: 15px;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
    font-family: 'Caveat', cursive;
    border: 5px solid #444;
}

.quiz-form-wrapper h1, 
.quiz-form-wrapper h2 {
    color: #fffbd6; /* Soft chalk yellow */
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 1); /* Sharper shadow */
}


.form-control {
    background-color: white;
    color: black;
    border: 1px solid black;
}

.form-control::placeholder {
    color: #777;
}

.btn-success {
    background-color: #60a917;
    border: none;
    transition: 0.3s;
}

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

/* ========== Phase 1: Quiz UI ========== */

.quiz-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quiz-header h1 {
    margin: 0;
}

.header-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.level-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffc107 0%, #ff6b6b 100%);
    color: #2e532e;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

#tts-toggle {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.3s;
}

#tts-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#tts-toggle.active {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: #ffc107;
}

.speaking-indicator {
    color: #ffc107;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 1rem;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.question-text {
    font-size: 2rem;
    font-weight: bold;
    color: #fffbd6;
    margin: 2rem 0;
    line-height: 1.4;
    min-height: 3rem;
    word-break: break-word;
}

.answer-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 2rem 0;
}

.answer-input {
    font-size: 2rem !important;
    font-weight: bold;
    padding: 1rem !important;
    text-align: center;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 3px solid #fffbd6 !important;
    color: #fffbd6 !important;
    border-radius: 8px;
}

.answer-input::placeholder {
    color: rgba(255, 251, 214, 0.5) !important;
}

.answer-input:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: #ffc107 !important;
    outline: none;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}

.submit-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    background-color: #60a917;
    border: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.submit-btn:hover {
    background-color: #4c8913;
    transform: scale(1.02);
}

.submit-btn:active {
    transform: scale(0.98);
}

.feedback-text {
    font-size: 1.3rem;
    font-weight: bold;
    min-height: 1.8rem;
    margin: 0 !important;
}

.correct-feedback {
    color: #90EE90 !important;
    animation: slideIn 0.3s ease-out;
}

.incorrect-feedback {
    color: #FF6B6B !important;
    animation: shake 0.3s ease-in-out;
}

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

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

/* Mobile-first responsiveness */
@media (max-width: 768px) {
    .blackboard {
        width: 95%;
        max-width: 100%;
        margin: 10px auto;
        padding: 1.5rem;
        min-height: 70vh;
    }

    .question-text {
        font-size: 1.8rem;
    }

    .answer-input {
        font-size: 1.5rem !important;
        padding: 0.8rem !important;
    }

    .quiz-header {
        flex-direction: column;
        margin-bottom: 1rem;
    }

    .quiz-header h1 {
        min-width: auto;
    }

    #tts-toggle {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .question-text {
        font-size: 1.5rem;
        margin: 1.5rem 0;
    }

    .answer-input {
        font-size: 1.3rem !important;
    }

    .submit-btn {
        font-size: 1rem;
        padding: 0.7rem 1rem;
    }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .speaking-indicator,
    .correct-feedback,
    .incorrect-feedback,
    .submit-btn {
        animation: none;
        transition: none;
    }
}