/* ========================================
   Notepad (우측 고정 메모장)
   워크샵용 EMR - 학생 메모 기능
   ======================================== */

.notepad {
    position: fixed;
    top: 60px; /* 헤더 아래 */
    right: 0;
    width: 400px;
    height: calc(100vh - 60px);
    background: #f0f4f8; /* 어두운 톤 블루 배경 */
    border-left: 3px solid #4a6fa5; /* 진한 블루 */
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 800;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.notepad.collapsed {
    transform: translateX(400px);
}

/* 메모장 토글 버튼 */
.notepad-toggle-btn {
    position: fixed;
    top: 120px;
    right: 0;
    background: linear-gradient(135deg, #4a6fa5 0%, #3a5a8a 100%); /* 어두운 블루 */
    color: white;
    border: none;
    border-radius: 6px 0 0 6px;
    padding: 12px 8px;
    cursor: pointer;
    z-index: 801;
    transition: all 0.3s ease;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-weight: 600;
    font-size: 13px;
    box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.2);
}

.notepad-toggle-btn:hover {
    background: linear-gradient(135deg, #3a5a8a 0%, #2a4a7a 100%);
    transform: translateX(-2px);
}

.notepad.collapsed ~ .notepad-toggle-btn {
    transform: translateX(0);
}

/* 메모장 헤더 */
.notepad-header {
    padding: 16px;
    background: linear-gradient(135deg, #4a6fa5 0%, #3a5a8a 100%); /* 어두운 블루 */
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.notepad-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.notepad-meta {
    font-size: 12px;
    opacity: 0.9;
}

/* 템플릿 인덱스 (Sticky) */
.notepad-index {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, #e8eef5 0%, #f0f4f8 100%); /* 연한 블루 */
    border-bottom: 2px solid #4a6fa5; /* 진한 블루 */
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.index-title {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.index-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.index-btn {
    padding: 6px 12px;
    font-size: 11px;
    background: #ffffff;
    border: 1px solid #4a6fa5; /* 진한 블루 */
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    color: #4a6fa5; /* 진한 블루 */
    transition: all 0.2s ease;
}

.index-btn:hover {
    background: linear-gradient(135deg, #4a6fa5 0%, #3a5a8a 100%); /* 어두운 블루 */
    color: white;
    border-color: #3a5a8a;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(74, 111, 165, 0.3);
}

/* 메모 작성 영역 */
.notepad-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
}

.notepad-textarea {
    flex: 1;
    width: 100%;
    padding: 16px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    line-height: 1.8;
    border: 1px solid #4a6fa5; /* 진한 블루 */
    border-radius: 8px;
    background: white;
    resize: none;
    outline: none;
    transition: all 0.2s ease;
}

.notepad-textarea:focus {
    border-color: #3a5a8a; /* 어두운 블루 */
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

.notepad-textarea::placeholder {
    color: #aaa;
    font-style: italic;
}

/* 메모장 푸터 */
.notepad-footer {
    padding: 16px;
    border-top: 1px solid #e0e0e0;
    background: #faf9f5;
}

.notepad-actions {
    display: flex;
    gap: 8px;
}

.notepad-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.notepad-btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
}

.notepad-btn-primary:hover {
    background: linear-gradient(135deg, #357abd 0%, #2868a8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

.notepad-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.notepad-btn-secondary:hover {
    background: #e0e0e0;
}

.notepad-btn-danger {
    background: #dc3545;
    color: white;
}

.notepad-btn-danger:hover {
    background: #c82333;
}

/* 자동 저장 상태 */
.autosave-status {
    margin-top: 12px;
    font-size: 11px;
    color: #666;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.autosave-status i {
    color: #28a745;
}

.autosave-status.saving {
    color: #ffc107;
}

.autosave-status.saving i {
    color: #ffc107;
}

/* 글자 수 카운터 */
.char-counter {
    margin-top: 12px;
    font-size: 11px;
    color: #999;
    text-align: right;
}

/* 빈 상태 */
.notepad-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #adb5bd;
    text-align: center;
    padding: 32px;
}

.notepad-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.notepad-empty p {
    font-size: 14px;
    margin: 0;
}

/* 스크롤바 스타일 */
.notepad-content::-webkit-scrollbar {
    width: 8px;
}

.notepad-content::-webkit-scrollbar-track {
    background: #f9f8f3;
}

.notepad-content::-webkit-scrollbar-thumb {
    background: #d4a574;
    border-radius: 4px;
}

.notepad-content::-webkit-scrollbar-thumb:hover {
    background: #b8935e;
}

/* 반응형 */
@media (max-width: 1400px) {
    .notepad {
        width: 350px;
    }
    
    .notepad.collapsed {
        transform: translateX(350px);
    }
}

@media (max-width: 1200px) {
    .notepad {
        width: 300px;
    }
    
    .notepad.collapsed {
        transform: translateX(300px);
    }
}
