/**
 * RecursiveSequenceCalculator.css
 * Calculator-specific styles ONLY
 * DO NOT redefine global classes from layout.css
 * See GLOBAL_CSS_CLASSES.md for reference
 */

/* ====================================
   Sequence Display Section
   ==================================== */

.sequence-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 2px solid #bae6fd;
    min-height: 60px;
    align-items: center;
    justify-content: center;
}

.sequence-term {
    padding: 8px 12px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.sequence-term:last-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #764ba2;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.sequence-term:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

/* ====================================
   Results Section
   ==================================== */

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.result-item {
    padding: 15px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    text-align: center;
    transition: all 0.3s ease;
}

.result-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.result-item-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-item-value {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Roboto Mono', monospace;
    word-break: break-all;
}

.result-item-large {
    grid-column: span 2;
}

.result-item-large .result-item-value {
    font-size: 2.2rem;
}

/* ====================================
   Characteristic Equation Display
   ==================================== */

.characteristic-equation {
    padding: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    border: 2px solid #fbbf24;
    margin: 15px 0;
    text-align: center;
}

.equation-formula {
    font-size: 1.3rem;
    font-family: 'Roboto Mono', monospace;
    color: #92400e;
    margin: 10px 0;
    font-weight: 600;
}

.equation-roots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.root-item {
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 2px solid #fbbf24;
}

.root-label {
    font-size: 0.8rem;
    color: #92400e;
    font-weight: 600;
    margin-bottom: 5px;
}

.root-value {
    font-size: 1.1rem;
    font-family: 'Roboto Mono', monospace;
    color: #b45309;
    font-weight: 700;
}

/* ====================================
   Calculation Steps
   ==================================== */

.calculation-steps {
    margin-top: 20px;
}

.calculation-step {
    padding: 12px 15px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid #48bb78;
    border-radius: 8px;
    margin-bottom: 10px;
    font-family: 'Roboto Mono', monospace;
    color: #166534;
    transition: all 0.3s ease;
}

.calculation-step:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.2);
}

.step-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-right: 10px;
}

.step-formula {
    font-weight: 600;
    color: #065f46;
}

/* ====================================
   Chart Container
   ==================================== */

.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.chart-container canvas {
    max-height: 100%;
}

/* ====================================
   Mode Selection Indicators
   ==================================== */

.mode-indicator {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

/* ====================================
   Initial Values Input Grid
   ==================================== */

.initial-values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin: 15px 0;
    max-width: 600px;
}

.initial-value-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.initial-value-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.initial-value-item label span {
    display: inline-block;
    margin-right: 5px;
}

.initial-value-item .form-input {
    width: 100%;
}

/* ====================================
   Convergence Info Box
   ==================================== */

.convergence-info {
    padding: 15px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    border: 2px solid #fbbf24;
    margin: 15px 0;
}

.convergence-info h4 {
    color: #92400e;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.convergence-value {
    font-size: 1.5rem;
    font-family: 'Roboto Mono', monospace;
    color: #b45309;
    font-weight: 700;
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    margin: 10px 0;
}

.golden-ratio-symbol {
    font-size: 2rem;
    color: #f59e0b;
    margin: 0 10px;
}

/* ====================================
   Error/Warning Messages
   ==================================== */

.error-message {
    padding: 12px 15px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #ef4444;
    border-radius: 8px;
    color: #991b1b;
    font-weight: 600;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message i {
    font-size: 1.2rem;
}

.warning-message {
    padding: 12px 15px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 8px;
    color: #92400e;
    font-weight: 600;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.warning-message i {
    font-size: 1.2rem;
}

/* ====================================
   Responsive Design
   ==================================== */

@media (max-width: 992px) {
    .initial-values-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-item-large {
        grid-column: span 1;
    }

    .result-item-value {
        font-size: 1.5rem;
    }

    .result-item-large .result-item-value {
        font-size: 1.8rem;
    }

    .equation-roots {
        grid-template-columns: 1fr;
    }

    .initial-values-grid {
        grid-template-columns: 1fr;
    }

    .sequence-term {
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    .chart-container {
        height: 250px;
    }
}

@media (max-width: 576px) {
    .sequence-display {
        gap: 6px;
        padding: 10px;
    }

    .sequence-term {
        font-size: 0.85rem;
        padding: 5px 8px;
    }

    .result-item-value {
        font-size: 1.3rem;
    }

    .characteristic-equation {
        padding: 15px;
    }

    .equation-formula {
        font-size: 1.1rem;
    }

    .chart-container {
        height: 200px;
        padding: 10px;
    }
}

/* ====================================
   Print Styles
   ==================================== */

@media print {
    .sequence-term {
        break-inside: avoid;
    }

    .calculation-step {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .chart-container {
        height: 400px;
        page-break-inside: avoid;
    }
}
