/* Cosine similarity visualization specific styles */

/* Sections */
section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

section:last-child {
    border-bottom: none;
}

section h3, section h4 {
    color: #333;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
}

section h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* Canvas Section */
.canvas-section {
    text-align: center;
}

.canvas-section p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.canvas-and-results {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    justify-content: center;
    margin: 0 auto;
    max-width: 800px;
}

.canvas-container {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#vectorCanvas {
    display: block;
    cursor: pointer;
    border-radius: 4px;
}

/* Live Results Panel */
.live-results {
    background: #f8f9fa;
    border: 2px solid #0066cc;
    border-radius: 8px;
    padding: 1.5rem;
    min-width: 280px;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
    text-align: center;
}

.live-results h4 {
    color: #0066cc;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.similarity-display {
    margin-bottom: 1rem;
}

.similarity-value {
    font-size: 3rem;
    font-weight: bold;
    color: #0066cc;
    font-family: 'Courier New', monospace;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.angle-display, .dot-product-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.vector-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.vector-display {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-size: 0.85rem;
}

.vector-display:last-child {
    margin-bottom: 0;
}

.vector-label {
    font-weight: 500;
    color: #333;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.vector-components {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #666;
    display: block;
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.vector-magnitude-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
}

.magnitude-label {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    color: #666;
    font-size: 0.85rem;
}

.magnitude-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #333;
    font-size: 0.85rem;
}

.angle-label, .dot-label {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

.angle-value, .dot-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #333;
    font-size: 1rem;
}

.interpretation-live {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.interpretation-text-live {
    background: #e6f2ff;
    border: 1px solid #0066cc;
    border-radius: 4px;
    padding: 0.75rem;
    color: #333;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: left;
}

/* Vector Information Section */
.vectors-display {
    display: flex;
    gap: 2rem;
    justify-content: space-around;
    margin-top: 0.75rem;
}

.vector-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    flex: 1;
    max-width: 200px;
}

.vector-info h4 {
    text-align: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.vector-info:first-child h4 {
    color: #dc3545; /* Red for Vector A */
}

.vector-info:last-child h4 {
    color: #007bff; /* Blue for Vector B */
}

.vector-coords, .vector-magnitude {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.vector-magnitude {
    margin-bottom: 0;
    padding-top: 0.5rem;
    border-top: 1px solid #dee2e6;
}

.coord-label, .magnitude-label {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

.coord-value, .magnitude-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #333;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: right;
}

/* Formula Section */
.formula {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.math-formula {
    font-size: 1.1rem;
    font-family: 'Times New Roman', serif;
    color: #333;
    font-style: italic;
}

.calculation-display {
    background: #e6f2ff;
    border: 1px solid #0066cc;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
}

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

.calc-label {
    display: block;
    font-weight: 500;
    color: #0066cc;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.calc-formula {
    font-size: 1rem;
    color: #333;
}

/* Results Section */
.calculations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.calc-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
}

.cosine-similarity-result {
    border-left: 4px solid #0066cc;
    background: #e6f2ff;
}

.calc-label {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.calc-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.2rem;
    color: #333;
}

.cosine-similarity-result .calc-value {
    color: #0066cc;
    font-size: 1.4rem;
}

/* Detailed Calculation */
.detailed-calculation {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.detailed-calculation h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.calculation-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step-label {
    font-weight: 500;
    color: #666;
    min-width: 120px;
    font-size: 0.9rem;
}

.step-formula {
    font-family: 'Courier New', monospace;
    color: #333;
    font-size: 0.85rem;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    border: 1px solid #dee2e6;
    flex: 1;
}

/* Interpretation Section */
.similarity-scale {
    margin: 1rem 0;
}

.scale-bar {
    position: relative;
    height: 20px;
    background: linear-gradient(to right, #dc3545, #ffc107, #28a745);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.scale-marker {
    position: absolute;
    top: -25px;
    transform: translateX(-50%);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.8rem;
    color: #333;
}

.similarity-indicator {
    position: absolute;
    top: -5px;
    width: 10px;
    height: 30px;
    background: #333;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.3s ease;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

.interpretation-text {
    background: #e6f2ff;
    border: 1px solid #0066cc;
    border-radius: 6px;
    padding: 1rem;
    color: #333;
    font-size: 0.95rem;
    text-align: center;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

/* Responsive design */
@media (max-width: 768px) {
    .canvas-and-results {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }
    
    .live-results {
        min-width: auto;
        width: 100%;
        max-width: 400px;
    }
    
    .similarity-value {
        font-size: 2.5rem;
    }
    
    .vectors-display {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .vector-info {
        max-width: 300px;
        width: 100%;
    }
    
    .calculations-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .canvas-container {
        padding: 0.5rem;
    }
    
    #vectorCanvas {
        width: 100%;
        max-width: 350px;
        height: auto;
    }
    
    .step {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .step-label {
        min-width: auto;
    }
    
    .step-formula {
        width: 100%;
        font-size: 0.8rem;
    }
    
    .math-formula {
        font-size: 1rem;
    }
}
