/* Confidence Interval Calculator Styles */
.ci-calculator-wrapper {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.ci-calculator-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.ci-calculator-card:hover {
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.08), 0 16px 32px rgba(0, 0, 0, 0.12);
}

.ci-input-section {
    padding: 2rem;
}

.ci-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
}

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

.ci-confidence-row {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ci-confidence-group {
    flex: 1;
    min-width: 0;
}

.ci-custom-input-wrapper {
    flex: 0 0 280px;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    animation: slideInRight 0.3s ease-out;
}

.ci-custom-input-wrapper[style*="display: flex"],
.ci-custom-input-wrapper[style*="display:flex"] {
    display: flex !important;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.ci-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.ci-label-text {
    flex: 1;
}

.ci-label-symbol {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.ci-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #fafafa;
    color: #1a1a1a;
}

.ci-input:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ci-input::placeholder {
    color: #999;
}

.ci-input-hint {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

.ci-confidence-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.ci-confidence-btn {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.ci-confidence-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-1px);
}

.ci-confidence-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.ci-input-custom {
    margin-top: 0.5rem;
}

.ci-action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.ci-btn {
    flex: 1;
    min-width: 150px;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ci-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ci-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

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

.ci-btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
}

.ci-btn-secondary:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.ci-btn-icon {
    font-size: 1.2rem;
}

/* Results Section */
.ci-results-section {
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-top: 3px solid #667eea;
    animation: slideIn 0.4s ease-out;
}

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

.ci-interval-display {
    margin-bottom: 2rem;
}

.ci-interval-range {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ci-bound {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.ci-bound-lower {
    color: #ef4444;
}

.ci-bound-upper {
    color: #10b981;
}

.ci-bound-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.ci-bound-value {
    font-size: 2rem;
    font-weight: 700;
}

.ci-interval-separator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ci-separator-line {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.ci-separator-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ci-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.ci-stat-card {
    background: white;
    padding: 1.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ci-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ci-stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ci-stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.ci-stat-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.ci-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
}

.ci-interpretation,
.ci-formula {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ci-interpretation-title,
.ci-formula-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.ci-interpretation-text {
    color: #444;
    line-height: 1.6;
    margin: 0;
}

.ci-formula-content {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.8;
    white-space: pre-line;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

/* Tablet Responsive Design */
@media (max-width: 1024px) {
    .ci-input-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ci-custom-input-wrapper {
        flex: 0 0 240px;
    }
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
    .ci-input-section,
    .ci-results-section {
        padding: 1.5rem;
    }

    .ci-input-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .ci-confidence-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }

    .ci-custom-input-wrapper {
        flex: 1;
        width: 100%;
    }

    .ci-confidence-options {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .ci-btn {
        width: 100%;
    }

    .ci-interval-range {
        flex-direction: column;
        padding: 1.5rem;
    }

    .ci-interval-separator {
        transform: rotate(90deg);
        margin: 0.5rem 0;
    }

    .ci-separator-line {
        width: 30px;
    }

    .ci-bound-value {
        font-size: 1.75rem;
    }

    .ci-stats-grid {
        grid-template-columns: 1fr;
    }

    .ci-stat-card {
        padding: 1rem;
    }

    .ci-stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .ci-stat-value {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .ci-calculator-wrapper {
        margin-top: 1rem;
    }

    .ci-input-section,
    .ci-results-section {
        padding: 1rem;
    }

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

    .ci-bound-value {
        font-size: 1.5rem;
    }

    .ci-confidence-options {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
.ci-input:focus-visible,
.ci-confidence-btn:focus-visible,
.ci-btn:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Loading State */
.ci-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
