/* Z-Score Calculator Styles */
.z-score-calculator {
    margin-bottom: 2rem;
}

.calculator-container {
    margin: 0 auto;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.mode-btn {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
}

.mode-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

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

.mode-icon {
    font-size: 20px;
}

.mode-label {
    font-weight: 500;
}

/* Calculator Card */
.calculator-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.input-column {
    display: flex;
    flex-direction: column;
}

.results-column {
    display: flex;
    flex-direction: column;
}

.calc-section {
    display: none;
}

.calc-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 28px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

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

/* Input Groups */
.input-group {
    margin-bottom: 24px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
}

.label-main {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.label-hint {
    display: block;
    font-size: 13px;
    color: #9ca3af;
    font-weight: 400;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #111827;
}

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

.input-field::placeholder {
    color: #9ca3af;
}

.textarea-field {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

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

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

.btn-secondary:hover {
    background: #e5e7eb;
    color: #111827;
}

.btn-icon {
    font-size: 18px;
}

/* Results Section */
.results-section {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 24px;
}

.results-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.results-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 12px;
}

.empty-state-description {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 16px;
    max-width: 320px;
}

.empty-state-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    text-align: left;
    max-width: 280px;
}

.empty-state-list li {
    font-size: 14px;
    color: #64748b;
    padding: 6px 0;
    padding-left: 24px;
    position: relative;
}

.empty-state-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: 600;
}

.empty-state-note {
    font-size: 13px;
    color: #94a3b8;
    font-style: italic;
    margin-top: 8px;
}

.results-content {
    animation: fadeIn 0.3s ease;
}

/* Single Result Display */
.single-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.result-item {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

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

.result-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.result-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

.result-item.primary .result-value {
    color: #2563eb;
}

/* Formula Display */
.formula-display {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.formula-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

.formula-equation {
    font-size: 20px;
    color: #2563eb;
    font-weight: 600;
    margin-bottom: 8px;
}

.formula-calculation {
    font-size: 15px;
    color: #64748b;
    margin-top: 8px;
}

/* Interpretation Box */
.interpretation-box {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.interpretation-title {
    font-size: 16px;
    font-weight: 600;
    color: #065f46;
    margin-bottom: 12px;
}

.interpretation-text {
    font-size: 15px;
    color: #047857;
    line-height: 1.6;
}

/* Percentile Box */
.percentile-box {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.percentile-title {
    font-size: 16px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 12px;
}

.percentile-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.percentile-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.percentile-detail-label {
    font-size: 12px;
    color: #92400e;
    font-weight: 500;
}

.percentile-detail-value {
    font-size: 18px;
    font-weight: 700;
    color: #b45309;
}

/* Bulk Results Table */
.bulk-results {
    margin-bottom: 24px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.results-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.results-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.results-table td {
    padding: 14px 16px;
    font-size: 15px;
    color: #111827;
    border-bottom: 1px solid #f1f5f9;
}

.results-table tbody tr:hover {
    background: #f8fafc;
}

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

.z-score-cell {
    font-weight: 600;
    color: #2563eb;
}

.classification-cell {
    font-weight: 600;
}

.classification-cell.extreme {
    color: #dc2626;
}

.classification-cell.unusual {
    color: #f59e0b;
}

.classification-cell.moderate {
    color: #3b82f6;
}

.classification-cell.typical {
    color: #10b981;
}

/* Summary Statistics */
.summary-stats {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
}

.summary-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
}

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

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.summary-value {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 2px solid #fca5a5;
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.error-icon {
    font-size: 20px;
    color: #dc2626;
}

.error-text {
    font-size: 15px;
    color: #991b1b;
    font-weight: 500;
}

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

    .results-section {
        position: static;
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .calculator-card {
        padding: 24px 20px;
    }

    .mode-selector {
        flex-direction: column;
    }

    .mode-btn {
        width: 100%;
    }

    .section-title {
        font-size: 20px;
    }

    .section-description {
        font-size: 14px;
    }

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

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .single-results {
        grid-template-columns: 1fr;
    }

    .results-section {
        padding: 20px 16px;
    }

    .results-title {
        font-size: 18px;
    }

    .empty-state {
        padding: 30px 16px;
    }

    .empty-state-icon {
        font-size: 48px;
    }

    .empty-state-title {
        font-size: 18px;
    }

    .table-wrapper {
        font-size: 14px;
    }

    .results-table th,
    .results-table td {
        padding: 10px 12px;
    }

    .percentile-details {
        grid-template-columns: 1fr;
    }

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

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

    .input-field {
        padding: 12px 14px;
        font-size: 15px;
    }

    .result-value {
        font-size: 24px;
    }

    .formula-equation {
        font-size: 18px;
    }
}
