/* Trig Facts Challenge - App-specific overrides */

:root {
    --app-accent: #F0697A; /* Pink — matches landing page trig card */
    --color-primary: #3b82f6;
    --color-primary-dark: #2563eb;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-gray-100: #f3f4f6;
    --color-gray-300: #d1d5db;
    --color-gray-500: #6b7280;
    --color-gray-700: #374151;
    --color-gray-900: #1f2937;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.07), 0 4px 12px rgba(0,0,0,0.08);
    --transition-base: all 0.2s ease;
}

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

body {
    color: var(--color-gray-900);
}

.card {
    margin: 0 auto;
}

.btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Trig-specific question sizing */
.question-text {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    letter-spacing: 1px;
    gap: 0.25rem;
}

/* Trig-specific level button override */
.level-btn {
    font-weight: 700;
    user-select: none;
}

/* Timer paused message */
#timer-paused-message {
    color: #ea580c;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    margin: 1rem 0;
    font-weight: 600;
    text-align: center;
}

#timer-paused-message.hidden {
    display: none;
}

/* Trig rating extras */
.rating-pro {
    background: linear-gradient(135deg, #dcfce7, #4ade80);
    color: #047857;
}

.rating-apprentice {
    background: linear-gradient(135deg, #f8fafc, #94a3b8);
    color: #1e293b;
}

/* Selectively reset Tailwind preflight styles inside MathQuill containers */
.mathquill-editable {
    margin: 0;
    border: 2px solid var(--color-primary);
    padding: 10px;
    line-height: normal;
}

/* MathQuill Input Styles */
.mathquill-input {
    min-width: 100px;
    height: 100px;
    border: 2px solid var(--color-primary);
    border-radius: 0.5rem;
    padding: 0.2rem;
    font-size: 2rem;
    background-color: white;
    margin: 0 0.25rem;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
}

.mathquill-input .mq-root-block {
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
}

.mathquill-input:focus-within {
    border-color: var(--color-primary-dark);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.mathquill-input.correct {
    border-color: var(--color-success);
    background-color: rgba(16, 185, 129, 0.05);
}

.mathquill-input.incorrect {
    border-color: var(--color-error);
    background-color: rgba(239, 68, 68, 0.05);
}

/* Quadrant diagram styling */
#quadrant-diagram {
    touch-action: none;
    user-select: none;
}

.diagram-container {
    padding: 1rem;
    background: linear-gradient(145deg, #f9fafb, #f3f4f6);
    border-radius: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* Utility classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.my-4 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.my-6 {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.my-8 {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.p-4 {
    padding: 1rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

/* Animation */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Responsive design */
@media (max-width: 768px) {
    .card {
        width: 100%;
        padding: 1.5rem;
    }

    .question-text {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }

    .level-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .level-btn {
        min-height: 80px;
        padding: 0.75rem;
    }

    .level-title {
        font-size: 0.8rem;
    }

    .mathquill-input {
        min-width: 80px;
        width: 80px;
        min-height: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }

    .card {
        padding: 1rem;
        border-radius: var(--radius-card);
    }

    .level-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .question-text {
        font-size: clamp(1.2rem, 3vw, 1.8rem);
    }

    .mathquill-input {
        min-width: 70px;
        width: 70px;
        min-height: 50px;
        height: 50px;
        font-size: 1rem;
    }
}

/* Success screen: red replay button */
#success-screen .btn-primary { background: #ef4444; }
#success-screen .btn-primary:hover { background: #dc2626; }
