/* styles/math-tutor.css */
/* Buzzy's Number Garden - Math Tutor Styles */

.math-tutor-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.math-tutor-container {
    background: linear-gradient(135deg, #fff9e6 0%, #fff5d6 100%);
    border-radius: 20px;
    width: 95%;
    max-width: 1100px;
    height: 90%;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
}

/* Header */
.math-tutor-header {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #e6a800;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.buzzy-icon {
    font-size: 32px;
    animation: buzzy-float 2s ease-in-out infinite;
}

@keyframes buzzy-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.math-tutor-header h2 {
    margin: 0;
    color: #4a3500;
    font-size: 1.4em;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.session-gold {
    background: rgba(255, 255, 255, 0.3);
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
    color: #4a3500;
}

.mt-btn-icon {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.mt-btn-icon:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Main Area */
.math-tutor-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.mt-left-panel {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.mt-right-panel {
    background: #f5f5dc;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-left: 3px solid #ddd;
}

#mt-grid-canvas {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Buzzy Dialogue */
.buzzy-dialogue {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.buzzy-avatar {
    font-size: 48px;
    flex-shrink: 0;
    animation: buzzy-float 2s ease-in-out infinite;
}

.buzzy-bubble {
    background: white;
    padding: 15px 20px;
    border-radius: 20px;
    border-bottom-left-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    font-size: 1.1em;
    line-height: 1.4;
    position: relative;
    color: #333;
}

.buzzy-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 15px;
    border: 10px solid transparent;
    border-right-color: white;
    border-left: 0;
}

/* Problem Area */
.mt-problem-area {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

.mt-question {
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    min-height: 50px;
}

.mt-input-area {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.mt-answer-input {
    width: 120px;
    height: 50px;
    font-size: 1.5em;
    text-align: center;
    border: 3px solid #FFD700;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
}

.mt-answer-input:focus {
    border-color: #FFA500;
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
}

.mt-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.mt-btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.mt-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.mt-btn-secondary {
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
    color: #333;
}

.mt-btn-secondary:hover {
    background: linear-gradient(135deg, #d0d0d0 0%, #c0c0c0 100%);
}

.mt-hint-area {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Feedback */
.mt-feedback {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    min-height: 50px;
}

.mt-feedback.correct {
    background: #d4edda;
    color: #155724;
    animation: correct-pulse 0.5s ease;
}

.mt-feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
}

.mt-feedback.summary {
    background: white;
    text-align: left;
}

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

/* Progress Bar */
.mt-progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 25px;
    position: relative;
    overflow: hidden;
}

.mt-progress-fill {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.mt-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #333;
    font-size: 0.9em;
}

/* Session Summary */
.session-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.summary-stat {
    background: #f0f0f0;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 1em;
}

/* Skill Tree Panel */
.mt-skill-tree-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 249, 230, 0.98);
    padding: 20px;
    overflow-y: auto;
    z-index: 10;
}

.mt-skill-tree-panel h3 {
    text-align: center;
    color: #4a3500;
    margin-bottom: 20px;
}

.skill-branch {
    margin-bottom: 25px;
}

.skill-branch h4 {
    color: #666;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #ddd;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-item {
    background: white;
    padding: 10px 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #ddd;
}

.skill-item.unlocked:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-color: #FFD700;
}

.skill-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.skill-item.medal-bronze {
    border-color: #cd7f32;
    background: linear-gradient(135deg, #fff 0%, #fdf5e6 100%);
}

.skill-item.medal-silver {
    border-color: #c0c0c0;
    background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
}

.skill-item.medal-gold {
    border-color: #FFD700;
    background: linear-gradient(135deg, #fff 0%, #fffacd 100%);
}

.skill-icon {
    font-size: 1.3em;
}

.skill-name {
    font-weight: bold;
    color: #333;
}

.skill-level {
    color: #666;
    font-size: 0.85em;
}

.skill-medal {
    font-size: 1.2em;
}

/* Responsive */
@media (max-width: 800px) {
    .math-tutor-main {
        flex-direction: column;
    }

    .mt-right-panel {
        border-left: none;
        border-top: 3px solid #ddd;
        max-height: 300px;
    }

    #mt-grid-canvas {
        max-width: 100%;
        height: auto;
    }
}
