/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0066cc;
    --primary-dark: #004999;
    --secondary-color: #00a8e8;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    --bg-main: #f5f7fa;
    --bg-white: #ffffff;
    --bg-light: #e9ecef;
    --bg-dark: #343a40;
    
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-light: #868e96;
    
    --border-color: #dee2e6;
    --border-radius: 4px;
    
    --sidebar-width: 280px;
    --header-height: 80px;
}

/* 낙상/욕창 위험도 평가 스타일 */
.intervention-list {
    list-style: none;
    padding: 0;
}

.intervention-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.intervention-list li:last-child {
    border-bottom: none;
}

.intervention-list i {
    margin-top: 3px;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

/* EMR Header */
.emr-header {
    height: var(--header-height);
    background: linear-gradient(135deg, #0066cc 0%, #004999 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hospital-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
}

.hospital-logo i {
    font-size: 28px;
}

.hospital-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    font-family: 'Arial', 'Helvetica', sans-serif;
}

.hospital-type {
    font-size: 12px;
    opacity: 0.9;
    padding-left: 15px;
    border-left: 1px solid rgba(255,255,255,0.3);
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.patient-banner {
    background: rgba(255,255,255,0.15);
    padding: 10px 30px;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.patient-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 3px;
}

.patient-id {
    font-size: 12px;
    opacity: 0.9;
}

.patient-diagnosis {
    font-size: 13px;
    font-weight: 500;
    margin-top: 3px;
    color: #ffd700;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.current-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.current-time {
    font-size: 12px;
    opacity: 0.9;
}

/* Main Container */
.emr-container {
    display: flex;
    margin-top: calc(var(--header-height) + 150px); /* 타임라인 네비게이터 높이 추가 */
    height: calc(100vh - var(--header-height) - 150px);
}

/* Sidebar */
.emr-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}

.sidebar-header {
    padding: 20px;
    background: var(--bg-light);
    border-bottom: 2px solid var(--primary-color);
}

.sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-tree {
    padding: 10px 0;
}

.menu-list {
    list-style: none;
}

.menu-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-primary);
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: var(--bg-light);
    border-left-color: var(--primary-color);
}

.menu-item.active {
    background: #e3f2fd;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.menu-divider {
    height: 2px;
    background: linear-gradient(to right, transparent, #dee2e6, transparent);
    margin: 15px 0;
    list-style: none;
}

.menu-item i {
    width: 18px;
    text-align: center;
}

.menu-expandable {
    justify-content: space-between;
    position: relative;
}

.expand-icon {
    transition: transform 0.3s;
    font-size: 12px;
}

.menu-expandable.expanded .expand-icon {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    display: none;
    background: var(--bg-light);
}

.menu-expandable.expanded .submenu {
    display: block;
}

.submenu li {
    padding: 10px 20px 10px 55px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.submenu li:hover {
    background: var(--bg-white);
    color: var(--primary-color);
}

.submenu li.active {
    background: var(--bg-white);
    color: var(--primary-color);
    font-weight: 500;
}

/* Main Content */
.emr-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-main);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.content-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.content-actions {
    display: flex;
    gap: 10px;
}

.content-actions button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: all 0.2s;
}

.content-actions button:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.content-body {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    min-height: 600px;
}

/* Section Styles */
.section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.info-item {
    display: flex;
    padding: 10px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 120px;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

.info-value.highlight {
    color: var(--danger-color);
    font-weight: 700;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 13px;
}

.data-table th {
    background: var(--bg-dark);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.data-table td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
}

.data-table tr:hover td {
    background: var(--bg-light);
}

/* Alert Box */
.alert-box {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.alert-box i {
    font-size: 20px;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: #333;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-info {
    background: var(--info-color);
    color: white;
}

/* Collapsible Section */
.collapsible-section {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    overflow: hidden;
}

.collapsible-header {
    background: var(--bg-light);
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: background 0.2s;
}

.collapsible-header:hover {
    background: #d3d8dd;
}

.collapsible-content {
    padding: 20px;
    display: none;
}

.collapsible-section.expanded .collapsible-content {
    display: block;
}

.collapsible-section.expanded .collapsible-header i {
    transform: rotate(180deg);
}

/* NIHSS Form */
.nihss-form {
    max-width: 800px;
}

.nihss-item {
    margin-bottom: 25px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-light);
}

.nihss-item-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.nihss-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nihss-option {
    display: flex;
    align-items: center;
    padding: 8px;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
}

.nihss-option:hover {
    background: #e3f2fd;
}

.nihss-option input[type="radio"] {
    margin-right: 10px;
}

.nihss-option.selected {
    background: #e3f2fd;
    border: 2px solid var(--primary-color);
}

.nihss-score {
    margin-top: 20px;
    padding: 20px;
    background: var(--primary-color);
    color: white;
    text-align: center;
    border-radius: var(--border-radius);
    font-size: 18px;
    font-weight: 700;
}

/* Flow Sheet Styles */
.flow-sheet {
    overflow-x: auto;
}

.flow-table {
    min-width: 1000px;
}

.flow-table th {
    min-width: 100px;
}

.flow-table td {
    text-align: center;
}

.vital-high {
    color: var(--danger-color);
    font-weight: 700;
}

.vital-low {
    color: var(--warning-color);
    font-weight: 700;
}

.vital-normal {
    color: var(--success-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
    
    .patient-banner {
        padding: 8px 20px;
    }
    
    .patient-name {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .emr-header {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 10px;
    }
    
    .header-left,
    .header-center,
    .header-right {
        width: 100%;
    }
    
    .emr-sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .emr-content {
        margin-left: 0;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Print Styles */
@media print {
    .emr-header,
    .emr-sidebar,
    .content-actions {
        display: none;
    }
    
    .emr-content {
        margin-left: 0;
        padding: 0;
    }
    
    .content-body {
        box-shadow: none;
    }
}

/* Timeline Styles */
.timeline-container {
    position: relative;
    padding: 20px 0;
}

.timeline-item {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    position: relative;
}

.timeline-marker {
    flex-shrink: 0;
    width: 120px;
    text-align: center;
}

.timeline-day {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin: 0 auto 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.timeline-critical .timeline-day {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.timeline-stable .timeline-day {
    background: linear-gradient(135deg, #ffc107, #e0a800);
}

.timeline-improving .timeline-day {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

.timeline-recovery .timeline-day {
    background: linear-gradient(135deg, #28a745, #218838);
}

.timeline-discharge .timeline-day {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
}

.timeline-date {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.timeline-content {
    flex: 1;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid var(--primary-color);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.timeline-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.nihss-badge {
    background: var(--primary-color);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.timeline-summary {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
}

.btn-view-detail {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-view-detail:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,102,204,0.3);
}

.timeline-connector {
    position: absolute;
    left: 60px;
    width: 4px;
    height: 60px;
    background: linear-gradient(to bottom, var(--primary-color), transparent);
    margin-top: -20px;
}

/* Date Filter Buttons */
.date-filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.date-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
}

.date-btn:hover {
    border-color: var(--primary-color);
    background: #e3f2fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,102,204,0.2);
}

.date-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0,102,204,0.3);
}


