/* Regression Calculator Styles */
.regression-calculator {
    margin-bottom: 2rem;
}

.calculator-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    max-width: 1400px;
    margin: 0 auto;
}

.calculator-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    position: relative;
}

.calculator-columns::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e5e7eb;
    transform: translateX(-50%);
}

/* Input Column */
.input-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-right: 1rem;
}

/* Results Column */
.results-column {
    display: flex;
    flex-direction: column;
    min-height: 400px;
    padding-left: 1rem;
}

.section-header {
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.section-description {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

.method-tabs {
    display: flex;
    gap: 0.75rem;
    background: #f9fafb;
    padding: 0.375rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.method-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.method-tab:hover {
    color: #374151;
    background: #ffffff;
}

.method-tab.active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.tab-icon {
    font-size: 1.125rem;
}

.tab-label {
    font-weight: 600;
}

/* Input Content */
.input-content {
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.label-main {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
}

.label-hint {
    font-size: 0.8125rem;
    color: #9ca3af;
}

.textarea-container {
    position: relative;
}

.data-textarea {
    width: 100%;
    padding: 1rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #111827;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    resize: vertical;
    transition: all 0.2s ease;
}

.data-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.data-count {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 500;
}

/* Table Controls */
.table-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.control-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
}

.point-select {
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    color: #111827;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.point-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.data-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    min-width: 300px;
}

.data-table thead {
    background: #f9fafb;
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e5e7eb;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.9375rem;
    color: #111827;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.data-table input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Action Group */
.action-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn-calculate,
.btn-clear {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

.btn-calculate {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-calculate:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-calculate:active {
    transform: translateY(0);
}

.btn-clear {
    background: #ffffff;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.btn-clear:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #d1d5db;
}

.btn-icon {
    font-size: 1.125rem;
}

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
}

.error-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.error-text {
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Results Column - Empty State and Content */
.results-column {
    position: sticky;
    top: 2rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.empty-description {
    font-size: 0.9375rem;
    color: #6b7280;
    max-width: 400px;
    margin: 0;
    line-height: 1.6;
}

/* Results Content */
.results-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    letter-spacing: -0.02em;
}

/* Equation Card */
.equation-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.equation-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.equation-formula {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
}

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

.metric-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.metric-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.metric-card.primary {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.metric-card.secondary {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.metric-card.accent {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.metric-card.highlight {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff 0%, #e9d5ff 100%);
}

.metric-icon {
    font-size: 2rem;
    font-weight: 700;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    flex-shrink: 0;
}

.metric-info {
    flex: 1;
    min-width: 0;
}

.metric-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    word-break: break-all;
}

/* Secondary Metrics */
.secondary-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.secondary-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.secondary-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.secondary-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}

/* Data Summary Card */
.data-summary-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1rem 0;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-grid > div {
    font-size: 0.9375rem;
    color: #374151;
    line-height: 1.6;
}

.summary-grid strong {
    color: #111827;
    font-weight: 600;
}

/* Prediction Card */
.prediction-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.prediction-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.prediction-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 1.25rem 0;
    line-height: 1.6;
}

.prediction-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.prediction-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
}

.prediction-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.predict-input {
    flex: 1;
    min-width: 200px;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    color: #111827;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.predict-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-predict {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    background: #3b82f6;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-predict:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.prediction-result {
    margin-top: 0.5rem;
    padding: 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    font-size: 0.9375rem;
    color: #1e40af;
    line-height: 1.6;
}

.prediction-result strong {
    font-weight: 600;
}

/* Formulas Card */
.formulas-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.5rem;
}

.formulas-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1rem 0;
}

.formulas-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.formula-item {
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.formula-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.formula-expression {
    font-size: 0.9375rem;
    color: #111827;
    line-height: 1.6;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .calculator-columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .calculator-columns::before {
        display: none;
    }

    .input-column {
        padding-right: 0;
    }

    .results-column {
        position: static;
        max-height: none;
        overflow-y: visible;
        padding-left: 0;
    }
}

@media (max-width: 768px) {
    .calculator-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .section-title,
    .results-title {
        font-size: 1.25rem;
    }

    .method-tabs {
        flex-direction: column;
    }

    .method-tab {
        width: 100%;
    }

    .action-group {
        flex-direction: column;
    }

    .btn-calculate,
    .btn-clear {
        width: 100%;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .secondary-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .equation-formula {
        font-size: 1.375rem;
    }

    .prediction-controls {
        flex-direction: column;
    }

    .predict-input {
        width: 100%;
        min-width: unset;
    }

    .btn-predict {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .calculator-card {
        padding: 1rem;
    }

    .section-title,
    .results-title {
        font-size: 1.125rem;
    }

    .equation-card {
        padding: 1.5rem;
    }

    .equation-formula {
        font-size: 1.125rem;
    }

    .metric-card {
        flex-direction: column;
        text-align: center;
    }

    .secondary-metrics {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.625rem 0.75rem;
    }
}
