/* Inherit variables from main.css */

.digit-demo-container {
    background-color: white;
    border-radius: 12px;
    margin: 0 auto;
    max-width: 900px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
}

.digit-header {
    text-align: center;
    margin-bottom: 2rem;
}

.digit-header h3 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.digit-header small {
    font-size: 1rem;
    color: var(--text-light);
    display: block;
    margin-top: 0.5rem;
}

.digit-content-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.canvas-section {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-section {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-box {
    display: inline-block;
    width: min-content;
    border: 2px solid var(--primary);
    cursor: crosshair;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    /* Ensure no extra space below the canvas */
    line-height: 0;
    font-size: 0;
}

.canvas-box canvas {
    display: block;
}

.canvas-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

#chart_box {
    width: 100%;
    max-width: 400px;
    background-color: white;
}

#pred_text {
    color: var(--primary);
    font-size: 1.2rem;
    margin-top: 1rem;
    font-weight: 600;
    text-align: center;
    min-height: 1.8rem; /* Reserve space */
}

/* Helper classes used by JS */
.d-none {
    display: none !important;
}

.prediction-text {
    /* Styles are handled by #pred_text ID, but class is needed for JS selector */
}

.back-link-container {
    text-align: center;
    margin-top: 3rem;
    margin-bottom: 2rem;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .digit-content-wrapper {
        flex-direction: column;
        gap: 2rem;
    }
    
    .digit-demo-container {
        padding: 1.5rem;
    }
}
