/* Custom styles for EWS Calculator */
@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;
}

/* PEWS Calculator Specific 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;
}

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

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

.main-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.patient-info, .vital-signs {
    margin-bottom: 30px;
}

.patient-info h2, .vital-signs 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;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

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

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

.parameters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

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

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

.parameter-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.parameter-header i {
    color: #3b82f6;
    font-size: 1.2rem;
}

.parameter-header h3 {
    color: #1f2937;
    font-size: 1.1rem;
    margin: 0;
    flex: 1;
}

.parameter-header .unit {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
}

.parameter-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

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

.score-display {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    transition: all 0.3s ease;
}

.score-display.score-0 {
    background: #dcfce7;
    color: #166534;
}

.score-display.score-1 {
    background: #fef3c7;
    color: #92400e;
}

.score-display.score-2 {
    background: #fed7aa;
    color: #9a3412;
}

.score-display.score-3 {
    background: #fee2e2;
    color: #991b1b;
}

.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.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;
}

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

.btn-reset:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

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

.btn-calculate:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-2px);
}

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

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

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

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

.total-score.stabil {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border: 2px solid #22c55e;
}

.total-score.perhatian {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
}

.total-score.waspada {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    border: 2px solid #f97316;
}

.total-score.kritis {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 2px solid #ef4444;
}

.score-number {
    font-size: 4rem;
    font-weight: 700;
    display: block;
    line-height: 1;
}

.score-label {
    font-size: 1.2rem;
    color: #6b7280;
    margin-top: 10px;
}

.category-info {
    padding: 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-info h3 {
    color: #1f2937;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.category-info p {
    color: #6b7280;
    line-height: 1.6;
}

.recommendations {
    margin-bottom: 30px;
}

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

.recommendation-list {
    list-style: none;
    padding: 0;
}

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

.recommendation-list li::before {
    content: "✓";
    color: #3b82f6;
    font-weight: bold;
    font-size: 1.2rem;
}

.score-breakdown {
    margin-bottom: 30px;
}

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

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

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

.breakdown-item .parameter-name {
    font-weight: 600;
    color: #374151;
}

.breakdown-item .parameter-score {
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f3f4f6;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

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

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

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

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

.btn-new {
    background: #8b5cf6;
    color: white;
}

.btn-new:hover {
    background: #7c3aed;
}

.footer {
    text-align: center;
    padding: 20px;
    color: white;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .main-content {
        padding: 20px;
    }

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

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

    .actions, .result-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Animation for results */
.results {
    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;
}

/* Navigation Card Styles */
.nav-card {
    position: relative;
    overflow: hidden;
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.nav-card:hover::before {
    left: 100%;
}

.nav-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Active navigation card */
.nav-card.bg-blue-50 {
    background: linear-gradient(135deg, #eff6ff, #dbeafe) !important;
}

.nav-card.bg-blue-50:hover {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe) !important;
}

/* 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); }
}

/* Scoring table styles */
.scoring-table {
    max-height: 70vh;
    overflow-y: auto;
}

.scoring-table::-webkit-scrollbar {
    width: 6px;
}

.scoring-table::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.scoring-table::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

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

/* Score color coding in reference table */
.score-green { color: #059669; font-weight: 600; }
.score-yellow { color: #d97706; font-weight: 600; }
.score-orange { color: #ea580c; font-weight: 600; }
.score-red { color: #dc2626; font-weight: 600; }

/* Highlight current score range */
.score-highlight {
    background-color: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding-left: 8px;
    margin-left: -8px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .grid-cols-1.lg\:grid-cols-4 {
        grid-template-columns: 1fr;
    }

    .scoring-table {
        max-height: 300px;
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .text-5xl {
        font-size: 3rem;
    }

    .text-xs {
        font-size: 0.75rem;
    }
}

/* 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;
    }

    .scoring-table {
        max-height: none;
        overflow: visible;
    }
}

/* Burn Calculator Styles */
.body-part {
    transition: all 0.3s ease;
    cursor: pointer;
}

.body-part:hover {
    stroke: #dc2626;
    stroke-width: 3;
}

.body-part.selected {
    fill: #fca5a5;
    stroke: #dc2626;
    stroke-width: 2;
}

.burn-severity-minor {
    background: linear-gradient(135deg, #10b981, #059669);
}

.burn-severity-moderate {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.burn-severity-major {
    background: linear-gradient(135deg, #fb923c, #ea580c);
}

.burn-severity-critical {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Burn percentage display */
.burn-percentage-display {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 2px solid #fca5a5;
}

/* Fluid calculation card */
.fluid-card {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid #93c5fd;
}

/* Body diagram container */
.body-diagram {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 1rem;
}

/* Age-based percentage display */
.age-percentage {
    background: #f3f4f6;
    border-left: 4px solid #3b82f6;
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
}

/* Palm method input */
.palm-input-container {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 1.5rem;
}

/* History modal for burn calculator */
.burn-history-item {
    transition: all 0.2s ease;
}

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

/* Responsive adjustments for burn calculator */
@media (max-width: 768px) {
    .body-diagram svg {
        width: 150px;
        height: 300px;
    }

    .burn-percentage-display {
        font-size: 2rem;
    }
}
