/* IWL Calculator - Injury Warning Level Styles */
/* CSS khusus untuk sistem triase trauma */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

/* Color Variables */
:root {
    --green-color: #28a745;
    --yellow-color: #ffc107;
    --orange-color: #fd7e14;
    --red-color: #dc3545;
    --blue-color: #007bff;
    --light-gray: #f8f9fa;
    --medium-gray: #6c757d;
    --dark-gray: #343a40;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

/* Header Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo i {
    font-size: 2rem;
    color: var(--white);
}

.logo h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-info {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subtitle {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.datetime {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Patient Information Section */
.patient-info {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: none;
}

.patient-info h2 {
    color: #3b82f6;
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.patient-form {
    display: grid;
    gap: 1rem;
}

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

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

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

/* Assessment Sections */
.assessment-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: none;
}

.assessment-section h2 {
    color: #3b82f6;
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

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

.assessment-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.assessment-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.assessment-card h3 {
    color: #1f2937;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.badge {
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 25px;
    text-align: center;
}

/* Radio Button Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.radio-option:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.radio-option input[type="radio"] {
    margin-right: 1rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + .radio-label {
    font-weight: 600;
    color: #2563eb;
}

.radio-option input[type="radio"]:checked ~ .score {
    background: #3b82f6;
    color: white;
    transform: scale(1.1);
}

.radio-label {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.score {
    background: #6b7280;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
    min-width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

/* Vital Signs */
.vital-signs {
    display: grid;
    gap: 1rem;
}

/* Injury Locations */
.injury-locations {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

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

.checkbox-option {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-option:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.checkbox-option input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #6b7280;
    border-radius: 4px;
    margin-right: 1rem;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-option input[type="checkbox"]:checked ~ .checkmark {
    background: #3b82f6;
    border-color: #3b82f6;
}

.checkbox-option input[type="checkbox"]:checked ~ .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-weight: bold;
}

.location-label {
    flex: 1;
    font-size: 0.9rem;
}

/* Action Buttons */
.action-section {
    margin: 2rem 0;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    text-decoration: none;
    min-width: 150px;
    justify-content: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #22c55e;
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-info {
    background: #3b82f6;
    color: white;
}

.btn-info:hover {
    background: #2563eb;
}

/* Results Section */
.results-section {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid #e2e8f0;
}

.results-section h2 {
    color: #3b82f6;
    font-size: 1.5rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-container {
    display: grid;
    gap: 2rem;
}

.score-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.total-score,
.triage-category {
    text-align: center;
    padding: 30px;
    border-radius: 15px;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.score-label,
.category-label {
    display: block;
    font-size: 1.2rem;
    color: #6b7280;
    margin-bottom: 10px;
}

.score-value {
    display: block;
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1;
}

.category-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Color-coded scores */
.score-value.green,
.category-value.green {
    color: #059669;
}

.score-value.yellow,
.category-value.yellow {
    color: #d97706;
}

.score-value.orange,
.category-value.orange {
    color: #ea580c;
}

.score-value.red,
.category-value.red {
    color: #dc2626;
}

/* Recommendations */
.recommendations,
.alerts,
.score-breakdown {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.recommendations h3,
.alerts h3,
.score-breakdown h3 {
    color: #1f2937;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

.recommendation-item,
.alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: white;
    border-left: 4px solid #3b82f6;
}

.recommendation-item i,
.alert-item i {
    font-size: 1.2rem;
    width: 20px;
}

.alert-item.critical {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.alert-item.warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.alert-item.info {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

/* Score Breakdown */
.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.breakdown-label {
    font-weight: 600;
    color: #374151;
}

.breakdown-score {
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    min-width: 25px;
    text-align: center;
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 30px;
}

.footer-content p {
    margin: 0.5rem 0;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header-info {
        text-align: center;
    }

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

    .score-display {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

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

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

/* Print styles */
@media print {
    header, button, .no-print {
        display: none !important;
    }

    body {
        background: white !important;
    }

    .bg-white {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .results-section {
        max-height: none;
        overflow: visible;
    }
}

/* Animation for results */
.results-section {
    animation: slideIn 0.5s ease-out;
}

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

/* Smooth transitions */
.transition {
    transition: all 0.3s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Score color indicators */
.score-stabil {
    background: linear-gradient(135deg, #10b981, #059669);
}

.score-perhatian {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.score-waspada {
    background: linear-gradient(135deg, #fb923c, #ea580c);
}

.score-kritis {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Result card animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.result-pulse {
    animation: pulse 2s infinite;
}

/* Input field focus effects */
input[type="number"]:focus,
input[type="text"]:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Radio button custom styling */
input[type="radio"]:checked + span {
    font-weight: 600;
    color: #2563eb;
}

/* History item hover effects */
.history-item {
    transition: all 0.2s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Loading spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus States for Accessibility */
.btn:focus,
input:focus,
select:focus {
    outline: 2px solid var(--blue-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 2px 10px rgba(0,0,0,0.3);
    }

    .assessment-card,
    .radio-option,
    .checkbox-option {
        border-width: 3px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
