/* Triangle Calculator Specific Styles */

.input-type-selector {
    margin: 20px 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
}

.input-type-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1f2937;
}

.input-type-select {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.input-type-select:focus {
    outline: none;
    border-color: #3b82f6;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}

.form-group input {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
}

.angle-unit-selector {
    margin: 20px 0;
}

.angle-unit-selector label {
    font-weight: 600;
    color: #1f2937;
    display: block;
    margin-bottom: 10px;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: normal;
}

.radio-group input[type="radio"] {
    cursor: pointer;
}

.error-message {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #dc2626;
}

/* Results Section */
.results-section {
    margin-top: 30px;
}

.results-section h2 {
    color: #1f2937;
    margin-bottom: 20px;
    font-size: 24px;
}

/* Triangle Diagram */
.triangle-diagram-container {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 350px;
}

#triangleDiagram {
    max-width: 100%;
    height: auto;
}

/* Solution Steps */
.solution-steps {
    margin: 30px 0;
}

.solution-steps h3 {
    color: #1f2937;
    margin-bottom: 20px;
    font-size: 20px;
}

.step-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step-content h4 {
    color: #1f2937;
    margin: 0 0 8px 0;
    font-size: 16px;
}

.step-content p {
    margin: 0;
    color: #4b5563;
    line-height: 1.6;
}

.step-diagram {
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 4px;
}

/* Warning Box for SSA Ambiguous Case */
.warning-box {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.warning-box h3 {
    color: #92400e;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-box p {
    color: #78350f;
    margin: 0;
    line-height: 1.6;
}

.solution-box {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.solution-box h3 {
    color: #1f2937;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

/* Triangle Properties */
.triangle-properties {
    margin: 30px 0;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.property-section {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.property-section h3 {
    color: #1f2937;
    font-size: 16px;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.property-item {
    padding: 8px 0;
    color: #4b5563;
    font-size: 15px;
    font-family: 'Courier New', monospace;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* Educational Content */
.educational-content {
    margin-top: 50px;
}

.educational-content h2 {
    color: #1f2937;
    font-size: 28px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3b82f6;
}

.content-section {
    margin: 40px 0;
}

.content-section h3 {
    color: #1f2937;
    font-size: 22px;
    margin-bottom: 20px;
}

.content-section h4 {
    color: #374151;
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 12px;
}

.content-section p {
    line-height: 1.8;
    color: #4b5563;
    margin-bottom: 15px;
}

.content-section ul {
    margin: 15px 0;
    padding-left: 25px;
}

.content-section li {
    margin: 10px 0;
    line-height: 1.7;
    color: #4b5563;
}

.content-section li strong {
    color: #1f2937;
}

/* Formula Boxes */
.formula-box {
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.formula-box h4 {
    color: #0c4a6e;
    margin: 0 0 15px 0;
}

.formula-box .math-formula {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
    font-size: 18px;
    overflow-x: auto;
}

.formula-box p {
    color: #0369a1;
    margin: 10px 0 0 0;
}

/* Example Boxes */
.example-box {
    background: #fef3c7;
    border: 2px solid #fde047;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
}

.example-box h4 {
    color: #92400e;
    margin: 0 0 15px 0;
}

.example-box p {
    color: #78350f;
    margin: 10px 0;
}

.example-steps {
    margin-top: 15px;
}

.example-steps p {
    margin: 15px 0;
    color: #78350f;
}

.example-steps strong {
    color: #92400e;
}

.example-steps .math-formula {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
    text-align: center;
}

/* FAQ Section */
.faq-section {
    margin-top: 40px;
}

.faq-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    transition: box-shadow 0.3s;
}

.faq-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.faq-item h4 {
    color: #1f2937;
    margin: 0 0 12px 0;
    font-size: 17px;
}

.faq-item p {
    color: #4b5563;
    margin: 0;
    line-height: 1.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .properties-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
    }
    
    .triangle-diagram-container {
        padding: 10px;
        min-height: 300px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .educational-content h2 {
        font-size: 24px;
    }
    
    .content-section h3 {
        font-size: 20px;
    }
    
    .formula-box .math-formula {
        font-size: 16px;
    }
}

/* KaTeX formula styling */
.math-formula .katex {
    font-size: 1.3em;
}

.math-formula .katex-display {
    margin: 0;
}
