/* P-Value Calculator Styles */
.pvalue-calculator {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

/* Single Full-Width Card */
.calculator-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    width: 100%;
}

/* Two Column Layout */
.calculator-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.input-column {
    display: flex;
    flex-direction: column;
    padding-right: 2rem;
    border-right: 1px solid #e5e7eb;
}

.results-column {
    display: flex;
    flex-direction: column;
    padding-left: 2rem;
}

.panel-header {
    margin-bottom: 2rem;
}

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

.panel-subtitle {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
}

/* Input Group */
.input-group {
    margin-bottom: 2rem;
}

.input-label {
    display: block;
    margin-bottom: 0.75rem;
}

.label-text {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.statistic-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
    transition: all 0.2s ease;
}

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

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

.input-clear {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    border-radius: 4px;
}

.input-wrapper:hover .input-clear,
.statistic-input:not(:placeholder-shown) ~ .input-clear {
    opacity: 1;
}

.input-clear:hover {
    color: #374151;
    background: #f3f4f6;
}

/* Test Type Options */
.test-type-group {
    margin-bottom: 2rem;
}

.test-type-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.75rem;
}

.test-type-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.test-type-option {
    position: relative;
    cursor: pointer;
}

.test-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-content {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    transition: all 0.2s ease;
    text-align: center;
}

.test-type-option:hover .option-content {
    border-color: #d1d5db;
    background: #f9fafb;
}

.test-type-option input[type="radio"]:checked + .option-content {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.option-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.option-desc {
    font-size: 0.8125rem;
    color: #6b7280;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-calculate {
    flex: 1;
    min-width: 160px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: #3b82f6;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

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

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

.btn-calculate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    display: flex;
    align-items: center;
}

.btn-reset {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset:hover {
    background: #e5e7eb;
    color: #374151;
    border-color: #d1d5db;
}

/* Results Column - Always visible */
.results-column {
    min-height: 400px;
}

.results-column .panel-header {
    margin-bottom: 1.5rem;
}

/* Animation for updated results */
.results-column.results-updated {
    animation: resultsPulse 0.5s ease;
}

@keyframes resultsPulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

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

.result-card.secondary {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}

.result-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.8);
    color: #3b82f6;
}

.result-card.secondary .result-icon {
    color: #10b981;
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Interpretation Box */
.interpretation-box {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
}

.interpretation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.interpretation-header svg {
    color: #3b82f6;
}

.interpretation-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #4b5563;
}

/* Significance Reference */
.significance-reference {
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.reference-header {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
}

.reference-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.reference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.ref-level {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

.ref-desc {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .calculator-card {
        padding: 1.5rem;
    }

    .calculator-columns {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .input-column {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 2rem;
        margin-bottom: 2rem;
    }

    .results-column {
        padding-left: 0;
        padding-top: 0;
        min-height: auto;
    }
}

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

    .panel-title {
        font-size: 1.25rem;
    }

    .test-type-options {
        grid-template-columns: 1fr;
    }

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

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

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

    .reference-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

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

    .panel-title {
        font-size: 1.125rem;
    }

    .statistic-input {
        padding: 0.75rem 2.5rem 0.75rem 0.875rem;
        font-size: 0.9375rem;
    }

    .result-card {
        padding: 1rem;
    }

    .result-icon {
        width: 40px;
        height: 40px;
    }

    .result-value {
        font-size: 1.125rem;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .calculator-card {
        background: #1f2937;
        border-color: #374151;
    }

    .input-column {
        border-right-color: #374151;
    }

    .panel-title {
        color: #f9fafb;
    }

    .panel-subtitle {
        color: #9ca3af;
    }

    .statistic-input {
        background: #111827;
        border-color: #374151;
        color: #f9fafb;
    }

    .statistic-input:focus {
        border-color: #3b82f6;
    }

    .option-content {
        background: #111827;
        border-color: #374151;
    }

    .test-type-option:hover .option-content {
        background: #374151;
    }

    .result-card {
        background: #111827;
        border-color: #374151;
    }

    .interpretation-box {
        background: #111827;
    }

    .significance-reference {
        background: #111827;
        border-color: #374151;
    }

    .reference-item {
        background: #1f2937;
        border-color: #374151;
    }

    @media (max-width: 991px) {
        .input-column {
            border-bottom-color: #374151;
        }
    }
}
