/* =============================================
   THEME STYLES - Math Platform
   © Situ Ghosh - All Rights Reserved
   ============================================= */

/* Blackboard Theme */
.blackboard {
    background: var(--blackboard-bg);
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 30px 30px;
    border: 12px solid #5d4037;
    border-radius: var(--radius-lg);
    box-shadow: 
        inset 0 0 50px rgba(0,0,0,0.3),
        0 10px 40px rgba(0,0,0,0.4);
    position: relative;
    min-height: 450px;
    padding: 30px;
    overflow: hidden;
}

.blackboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.2) 100%);
    pointer-events: none;
}

/* Blackboard Frame */
.blackboard-frame {
    background: linear-gradient(180deg, #6d4c41 0%, #4e342e 50%, #3e2723 100%);
    padding: 15px;
    border-radius: var(--radius-lg);
    box-shadow: 
        0 5px 20px rgba(0,0,0,0.3),
        inset 0 2px 4px rgba(255,255,255,0.1);
}

/* Chalk Text Styles */
.chalk-text {
    font-family: 'Caveat', cursive;
    color: var(--chalk-white);
    text-shadow: 
        0 0 5px rgba(255,255,255,0.3),
        2px 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.chalk-text.yellow { color: var(--chalk-yellow); }
.chalk-text.blue { color: var(--chalk-blue); }
.chalk-text.red { color: var(--chalk-red); }

/* Solution Display */
.solution-display {
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px;
}

.solution-line {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    color: var(--chalk-white);
    margin-bottom: 12px;
    text-shadow: 
        0 0 8px rgba(255,255,255,0.2),
        1px 1px 2px rgba(0,0,0,0.5);
    opacity: 0;
    animation: chalkWrite 0.4s ease forwards;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
}

.solution-line:nth-child(1) { animation-delay: 0.1s; }
.solution-line:nth-child(2) { animation-delay: 0.3s; }
.solution-line:nth-child(3) { animation-delay: 0.5s; }
.solution-line:nth-child(4) { animation-delay: 0.7s; }
.solution-line:nth-child(5) { animation-delay: 0.9s; }
.solution-line:nth-child(6) { animation-delay: 1.1s; }
.solution-line:nth-child(7) { animation-delay: 1.3s; }
.solution-line:nth-child(8) { animation-delay: 1.5s; }
.solution-line:nth-child(9) { animation-delay: 1.7s; }
.solution-line:nth-child(10) { animation-delay: 1.9s; }
.solution-line:nth-child(n+11) { animation-delay: 2.1s; }

.solution-line.highlight {
    color: var(--chalk-yellow);
    font-size: 2.2rem;
    margin-top: 15px;
}

.solution-line.answer {
    color: var(--chalk-yellow);
    font-weight: 600;
    border-bottom: 2px dashed var(--chalk-yellow);
    padding-bottom: 5px;
}

/* Blackboard Empty State */
.blackboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 350px;
    color: rgba(255,255,255,0.3);
    text-align: center;
}

.blackboard-empty i {
    font-size: 4rem;
    margin-bottom: 20px;
}

.blackboard-empty p {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
}

/* Math Input Area */
.math-input-area {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.math-input-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.math-input-header i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.math-input-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.math-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    resize: vertical;
    transition: var(--transition);
}

.math-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 126, 0.1);
}

.math-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Profile Section Styles */
.tutor-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.tutor-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tutor-avatar i {
    font-size: 2.5rem;
    color: var(--text-light);
}

.tutor-info h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.tutor-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.tutor-info .subtitle {
    font-weight: 500;
    color: var(--secondary-color);
}

/* API Key Settings */
.api-settings {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.api-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.api-status .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.api-status .status-dot.connected {
    background: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.api-status .status-dot.disconnected {
    background: #dc3545;
}

.api-settings button {
    margin-left: auto;
    padding: 8px 15px;
    background: var(--background-light);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.api-settings button:hover {
    background: var(--primary-color);
    color: var(--text-light);
}

/* Color Palette for Chalk */
.chalk-palette {
    display: flex;
    gap: 10px;
    padding: 15px 0;
}

.chalk-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
}

.chalk-color:hover {
    transform: scale(1.15);
}

.chalk-color.active {
    border-color: var(--secondary-color);
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* Code Editor Theme */
.code-editor {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: var(--radius-md);
    min-height: 400px;
    overflow: auto;
}

.code-editor .line-numbers {
    color: #858585;
    padding-right: 15px;
    border-right: 1px solid #404040;
    margin-right: 15px;
    user-select: none;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 15px 30px;
    background: var(--secondary-color);
    color: var(--text-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast.warning {
    background: var(--accent-color);
    color: var(--secondary-color);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: var(--text-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay p {
    color: var(--text-light);
    margin-top: 15px;
    font-size: 1rem;
}

/* Typing Animation for AI Response */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background: var(--chalk-white);
    margin-left: 5px;
    animation: blink 0.8s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* GeoGebra Container */
.geogebra-container {
    width: 100%;
    height: 600px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
}

/* Whiteboard Specific */
.whiteboard-canvas-wrapper {
    position: relative;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.whiteboard-canvas {
    display: block;
    cursor: crosshair;
}

/* Construction Tools */
.construction-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    padding: 15px;
    background: var(--background-light);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.construction-tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 8px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.construction-tool:hover {
    border-color: var(--primary-color);
}

.construction-tool.active {
    background: var(--primary-color);
    color: var(--text-light);
}

.construction-tool i {
    font-size: 1.3rem;
}

.construction-tool span {
    font-size: 0.7rem;
    text-align: center;
}

/* Save Dialog Specific */
.save-dialog-content {
    max-width: 500px;
}

.save-dialog-content .form-group {
    margin-bottom: 20px;
}

.save-dialog-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.save-dialog-content select,
.save-dialog-content input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
}

.save-dialog-content select:focus,
.save-dialog-content input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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