/* Apandisit Testi (Alvarado Skoru) - Medical Emergency Theme */

/* Base Styles */
#apandisit-wrapper {
    max-width: 1000px;
    margin: 40px auto;
    padding: 30px;
    font-family: inherit;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

/* Header */
.apandisit-header {
    text-align: center;
    padding: 25px 20px;
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
    margin: -30px -30px 30px -30px;
    border-radius: 10px 10px 0 0;
}

.apandisit-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.apandisit-header p {
    margin: 0;
    font-size: 1rem;
}

/* Form Sections */
.form-section {
    background: #fff8f0;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.section-title {
    color: #dc3545;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #fd7e14;
}

/* Form Controls */
.form-control {
    padding: 12px 15px !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    background: #fff !important;
}

.form-control:focus {
    border-color: #fd7e14 !important;
    box-shadow: 0 0 0 3px rgba(253, 126, 20, 0.1) !important;
    transform: translateY(-1px) !important;
}

.form-control.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.form-text.text-muted {
    font-size: 0.85rem !important;
    color: #6c757d !important;
    margin-top: 5px !important;
}

/* Question Groups */
.question-group {
    background: white;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 18px;
    transition: all 0.3s ease;
}

.question-group:hover {
    border-color: #fd7e14;
    box-shadow: 0 2px 8px rgba(253, 126, 20, 0.1);
}

.question-label {
    font-weight: 600;
    color: #dc3545;
    font-size: 1rem;
    display: block;
    margin-bottom: 12px;
    line-height: 1.5;
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-check {
    margin-bottom: 0;
}

.form-check-input {
    margin-top: 0.25rem !important;
    margin-right: 8px !important;
    transform: scale(1.2);
}

.form-check-input:checked {
    background-color: #fd7e14 !important;
    border-color: #fd7e14 !important;
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(253, 126, 20, 0.25) !important;
}

.form-check-label {
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    padding-left: 5px;
}

/* Orange Button */
.btn-orange {
    background: linear-gradient(135deg, #fd7e14 0%, #dc3545 100%) !important;
    border: none !important;
    color: white !important;
    padding: 12px 30px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

.btn-orange:hover {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(253, 126, 20, 0.3) !important;
}

.btn-orange:focus {
    box-shadow: 0 0 0 3px rgba(253, 126, 20, 0.25) !important;
    color: white !important;
}

/* Result Section - Hidden by default */
.result-section {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    background: #fff8f0;
    padding: 25px;
    border-radius: 10px;
    margin-top: 30px;
    border: 1px solid #fed7aa;
    height: 0 !important;
    overflow: hidden !important;
}

.result-section.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    animation: fadeInUp 0.5s ease;
}

#apandisit-result:not(.show) {
    display: none !important;
    visibility: hidden !important;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Score Display */
.result-header {
    margin-bottom: 25px;
}

.score-display {
    font-size: 3.5rem;
    font-weight: 800;
    color: #dc3545;
    margin-bottom: 8px;
}

.score-unit {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

/* Risk Level Status */
.risk-status {
    font-size: 1.3rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.risk-status.low-risk {
    background: #198754;
    color: white;
}

.risk-status.moderate-risk {
    background: #ffc107;
    color: #212529;
}

.risk-status.high-risk {
    background: #dc3545;
    color: white;
}

/* Status Box */
.status-box {
    background: white;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.status-box.low-risk {
    border-color: #198754;
    background: #f0f9ff;
}

.status-box.moderate-risk {
    border-color: #ffc107;
    background: #fffbeb;
}

.status-box.high-risk {
    border-color: #dc3545;
    background: #fef2f2;
}

.status-box h6 {
    color: #dc3545;
    font-weight: 700;
    margin-bottom: 12px;
}

.status-box p {
    margin: 0;
    line-height: 1.6;
    color: #374151;
}

.status-box.low-risk p {
    color: #065f46;
}

.status-box.moderate-risk p {
    color: #92400e;
}

.status-box.high-risk p {
    color: #991b1b;
}

/* Recommendation Box */
.recommendation-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
}

.recommendation-box h6 {
    color: #dc3545;
    font-weight: 700;
    margin-bottom: 10px;
}

.recommendation-box p {
    margin: 0;
    color: #856404;
    line-height: 1.5;
    font-weight: 500;
}

/* Alvarado Score Table */
.alvarado-evaluation h6 {
    color: #dc3545;
    font-weight: 700;
}

.table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.table th {
    background: #dc3545 !important;
    color: white !important;
    font-weight: 600;
    border: none !important;
    padding: 12px 8px !important;
    font-size: 0.9rem;
}

.table td {
    padding: 10px 8px !important;
    vertical-align: middle !important;
    border-color: #fed7aa !important;
    font-size: 0.9rem;
}

.score-row.highlighted {
    background: #fff3cd !important;
    font-weight: 600;
}

.score-row.highlighted td {
    border-color: #ffc107 !important;
    color: #856404 !important;
}

/* Medical Warning */
.medical-warning {
    background: #f8d7da;
    border: 1px solid #dc3545;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}

.medical-warning small {
    color: #721c24;
    line-height: 1.4;
    font-weight: 600;
}

/* Emergency Note */
.emergency-note {
    background: #dc3545;
    color: white;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    margin-top: 20px;
    animation: pulse 2s infinite;
}

.emergency-note.show {
    display: block;
}

.emergency-note.hide {
    display: none;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #apandisit-wrapper {
        margin: 20px;
        padding: 20px;
        border-radius: 8px;
    }
    
    .apandisit-header {
        margin: -20px -20px 25px -20px;
        padding: 20px 15px;
        border-radius: 8px 8px 0 0;
    }
    
    .apandisit-header h3 {
        font-size: 1.5rem;
    }
    
    .apandisit-header p {
        font-size: 0.9rem;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .question-group {
        padding: 15px;
    }
    
    .radio-group {
        gap: 15px;
    }
    
    .score-display {
        font-size: 2.8rem;
    }
    
    .table th,
    .table td {
        padding: 8px 6px !important;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .apandisit-header h3 {
        font-size: 1.3rem;
    }
    
    .apandisit-header p {
        font-size: 0.85rem;
    }
    
    .form-section {
        padding: 12px;
    }
    
    .question-group {
        padding: 12px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .score-display {
        font-size: 2.5rem;
    }
    
    .form-control {
        padding: 10px 12px !important;
        font-size: 0.95rem !important;
    }
    
    .btn-orange {
        padding: 10px 25px !important;
        font-size: 1rem !important;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 6px 4px !important;
        font-size: 0.75rem;
    }
}

/* Focus States */
.btn:focus {
    outline: none !important;
}

/* Print Styles */
@media print {
    #apandisit-wrapper {
        box-shadow: none;
        border: 1px solid #000;
        margin: 0;
        break-inside: avoid;
    }
    
    .apandisit-header {
        background: #f8f9fa !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
    }
    
    .btn {
        display: none;
    }
    
    .result-section {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .emergency-note {
        animation: none !important;
        background: #dc3545 !important;
        -webkit-print-color-adjust: exact;
    }
}
