/* =========================================================
   히브리어 & 헬라어 원어 성경 전용 핵심 스타일 (Light & Fast)
   ========================================================= */

:root {
    --bg: #f8fafc;
    --fg: #334155;
    --card: #ffffff;
    --border: #e2e8f0;
    --brand: #2563eb;
    --brand-hover: #1d4ed8;
    --muted: #94a3b8;
    --highlight: rgba(59, 130, 246, 0.15);
}

body.dark-mode {
    --bg: #0f172a;
    --fg: #e2e8f0;
    --card: #1e293b;
    --border: #334155;
    --brand: #3b82f6;
    --brand-hover: #60a5fa;
    --muted: #64748b;
    --highlight: rgba(59, 130, 246, 0.25);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Noto Sans KR', sans-serif; background: var(--bg); color: var(--fg); -webkit-tap-highlight-color: transparent; }

.bible-wrap { max-width: 800px; margin: 0 auto; background: var(--card); min-height: 100vh; padding-top: 60px; padding-bottom: 80px; box-shadow: 0 0 20px rgba(0,0,0,0.05); position: relative; }

/* --- 상단 헤더 --- */
.top-header { position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 800px; height: 60px; background: var(--card); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; padding: 0 12px; z-index: 1000; }
.header-left, .header-right { display: flex; align-items: center; justify-content: center; width: 40px; }
.btn-menu, .btn-home { background: none; border: none; padding: 6px; color: var(--fg); cursor: pointer; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.btn-menu:hover, .btn-home:hover { background: var(--bg); }

.top-nav-selects { display: flex; gap: 6px; flex: 1; justify-content: center; margin: 0 8px; }
.top-select { padding: 6px 22px 6px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 6px center; appearance: none; -webkit-appearance: none; font-family: 'Noto Sans KR', sans-serif; font-size: 0.95rem; font-weight: 700; color: var(--fg); cursor: pointer; outline: none; max-width: 110px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.top-select:focus { border-color: var(--brand); }

/* --- 뱃지 디자인 --- */
.badge-hebrew { background: #e0e7ff; color: #4338ca; font-size: 0.75rem; padding: 4px 10px; border-radius: 12px; font-weight: 800; white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
body.dark-mode .badge-hebrew { background: #3730a3; color: #e0e7ff; }
.badge-greek { background: #fce7f3; color: #be185d; font-size: 0.75rem; padding: 4px 10px; border-radius: 12px; font-weight: 800; white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
body.dark-mode .badge-greek { background: #831843; color: #fce7f3; }

/* --- 사이드바 및 역본 핑크색 토글 --- */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: none; backdrop-filter: blur(2px); }
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: #fff;
    z-index: 10000;
    transform: translateX(-100%); /* 왼쪽으로 숨김 */
    transition: transform 0.3s ease;
}
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.sidebar-header h2 { margin: 0; font-size: 1.2rem; }
.btn-close { background: none; border: none; font-size: 1.8rem; color: var(--muted); cursor: pointer; }
.sidebar-content { padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.menu-group label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.modern-select { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--fg); font-size: 1rem; outline: none; cursor: pointer; }
.btn-apply { margin-top: 10px; width: 100%; padding: 14px; background: var(--brand); color: #fff; border: none; border-radius: 8px; font-weight: 700; font-size: 1rem; cursor: pointer; }

/* 다중 역본 핑크색 스위치 스타일 */
.version-toggles { display: flex; flex-direction: column; gap: 8px; }
.btn-toggle {
    width: 100%; padding: 12px; border-radius: 8px;
    background: var(--bg); border: 2px solid var(--border);
    color: var(--muted); font-size: 1rem; font-weight: 700;
    text-align: center; cursor: pointer; transition: 0.2s;
}
.btn-toggle.active {
    border-color: #db2777; 
    background: #fdf2f8; 
    color: #be185d;      
}
body.dark-mode .btn-toggle.active { border-color: #ec4899; background: #831843; color: #fbcfe8; }

/* --- 성경 본문 층(Layer) 구조 --- */
.verse-list { padding: 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.verse-row { display: flex; align-items: flex-start; gap: 1px; padding-bottom: 13px; border-bottom: 1px dashed var(--border); }
.verse-row:last-child { border-bottom: none; }
.verse-num { font-weight: 800; color: var(--brand); font-size: 0.9rem; margin-top: 3px; min-width: 20px; }

/* 절 안의 텍스트가 쌓이는 층 */
.verse-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.text-layer { display: none; padding-bottom: 8px; border-bottom: 1px dotted rgba(0,0,0,0.05); }
.text-layer:last-child { padding-bottom: 0; border-bottom: none; }

/* 한글/영어 본문 폰트 */

/* 히브리어 폰트 */
.hebrew-container { font-size: 1.8rem; line-height: 2.0; font-family: 'SBL Hebrew', 'Ezra SIL', serif; direction: rtl; text-align: right; color: var(--fg); }
.he-word { cursor: pointer; padding: 0 2px; border-radius: 4px; transition: background 0.2s, color 0.2s; display: inline-block; unicode-bidi: isolate; }

/* ★ 헬라어 폰트 강제 적용 (PC 한글 폰트 침범 완벽 방어) */
.greek-container, .gr-word { 
    font-family: 'SBL Greek', 'Palatino Linotype', 'Times New Roman', 'Arial', serif !important; 
    letter-spacing: 0 !important; 
    word-spacing: 2px !important;
}
.greek-container {
    font-size: 1.5rem; line-height: 1.9; 
    direction: ltr; text-align: left; color: var(--fg); 
}
.gr-word { 
    cursor: pointer; padding: 0 2px; border-radius: 4px; 
    transition: background 0.2s, color 0.2s; 
    display: inline; 
}

.he-word:hover, .gr-word:hover { background: var(--highlight); color: var(--brand); }
.selected-word { background: var(--highlight) !important; color: var(--brand) !important; font-weight: bold; }
.empty-data { padding: 50px 20px; text-align: center; color: var(--muted); font-size: 1rem; }

/* --- 하단 네비게이션 --- */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 800px; background: var(--card); border-top: 1px solid var(--border); display: flex; justify-content: space-between; padding: 12px 20px; z-index: 1000; }

/* ★ 버튼 거대화 방지용 높이 고정 */
.btn-nav { 
    background: var(--bg); border: 1px solid var(--border); color: var(--fg); 
    padding: 0 16px; border-radius: 20px; font-size: 0.95rem; font-weight: 700; 
    cursor: pointer; display: flex; align-items: center; gap: 6px; transition: 0.2s;
    height: 40px; /* 높이를 정확하게 40px로 잠금 */
    max-height: 40px;
    flex: 0 0 auto;
    min-width: 90px;
    justify-content: center;
}
.btn-nav:hover:not(:disabled) { background: var(--border); }
.btn-nav:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- 사전 팝업 --- */
#modernLexPopup { position: absolute; background: #ffffff; border: 1px solid #e2e8f0; z-index: 100000; border-radius: 12px; width: 280px; box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15); font-family: 'Noto Sans KR', sans-serif; color: #334155; animation: popFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1); overflow: hidden; text-align: left; direction: ltr; }
@keyframes popFadeIn { 0% { opacity: 0; transform: translateY(-5px) scale(0.98); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.lex-header-wrap { background: #1e293b; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.lex-word { font-size: 1.6rem; color: #f8fafc; font-family: 'SBL Hebrew', 'Ezra SIL', serif; font-weight: normal; direction: rtl; }
.lex-close { background: none; border: none; color: #94a3b8; font-size: 1.4rem; cursor: pointer; padding: 0; line-height: 1; transition: 0.2s; }
.lex-close:hover { color: #f1f5f9; }
.lex-body { padding: 16px; font-size: 0.95rem; line-height: 1.5; }
.lex-row { display: flex; align-items: baseline; margin-bottom: 8px; }
.lex-label { display: inline-block; width: 45px; font-size: 0.8rem; font-weight: 700; color: #64748b; flex-shrink: 0; }
.lex-value { flex: 1; color: #1e293b; }
.lex-value.bold { font-weight: 700; color: #0f172a; }
.lex-parsing { color: #d97706; font-size: 0.9rem; font-weight: 600; }
.hebrew-font { font-family: 'SBL Hebrew', serif; font-size: 1.2rem; direction: rtl; display: inline-block; }
.greek-font { font-family: 'SBL Greek', 'Palatino Linotype', 'Times New Roman', serif; font-size: 1.1rem; direction: ltr; display: inline-block; letter-spacing: normal; }
.lex-usage-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #cbd5e1; }
.lex-usage { margin-top: 6px; font-size: 0.9rem; color: #475569; background: #f8fafc; padding: 10px; border-radius: 6px; }
.lex-error { padding: 20px; text-align: center; color: #ef4444; font-weight: bold; }
body.dark-mode #modernLexPopup { background: #1e293b; border-color: #334155; }
body.dark-mode .lex-header-wrap { background: #0f172a; }
body.dark-mode .lex-value, body.dark-mode .lex-value.bold { color: #f8fafc; }
body.dark-mode .lex-usage { background: #0f172a; color: #cbd5e1; }

/* 사이드바 활성화 상태 */
.sidebar.active {
    transform: translateX(0);
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* 해석 박스 내 탭 버튼 스타일 */
.v-tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
    cursor: pointer;
    font-weight: 500;
}
.v-tab-btn.active {
    background: #ffffff;
    border-bottom: 2px solid #2563eb; /* 목사님 선호하는 파란색 계열 */
    color: #2563eb;
    font-weight: 700;
}
.v-tab-content {
    min-height: 200px;
    line-height: 1.8;
}
.v-tab-btn {
    flex: 1;
    padding: 10px 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    border: none;
    background: #f1f5f9;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.v-tab-btn.active {
    background: #fff;
    border-bottom: 2px solid #673ab7;
    font-weight: bold;
    color: #673ab7;
}
.hent-analysis-box {
    background: #fff;
    padding: 10px;
}
/* 탭 바 가로 스크롤 허용 (모바일 대응) */
.v-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    border-bottom: 1px solid #e2e8f0;
}
.v-tab-btn {
    flex: 0 0 auto; /* 폭 고정 해제 */
    padding: 10px 15px;
    font-size: 0.85rem;
}
/* 주/야 버튼 스타일 */
.mode-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 토큰 하단 데이터(lemma, kor_meaning) 배경 설정 */
.token-sub {
    display: block;
    background: #f1f5f9; /* 주간 모드 기본 배경 */
    padding: 2px 4px;
    border-radius: 4px;
    margin-top: 2px;
    transition: background 0.3s;
}

.token-sub .lemma { font-size: 0.85rem; color: #475569; }
.token-sub .meaning { font-size: 0.9rem; color: #1e40af; font-weight: 500; }

/* ----------------------------------------------- */
/* 다크 모드 적용 시 변하는 부분 */
/* ----------------------------------------------- */

body.dark-mode {
    --bg: #0f172a;
    --fg: #e2e8f0;
    --card: #1e293b;
    --border: #334155;
}

/* 다크 모드일 때 토큰 밑 박스 배경을 어둡게 변경 */
body.dark-mode .token-sub {
    background: #334155 !important;
}

/* 다크 모드일 때 텍스트 색상 조정 */
body.dark-mode .token-sub .lemma {
    color: #94a3b8;
}

body.dark-mode .token-sub .meaning {
    color: #60a5fa; /* 다크모드에서 잘 보이는 밝은 파란색 */
}

/* 다크 모드일 때 선택된 토큰 강조 */
body.dark-mode .token-item.selected .token-sub {
    background: #1e40af !important;
    color: #ffffff;
}
/* 주/야 버튼 기본 스타일 */
.mode-toggle-btn {
    background: #f1f5f9; /* 배경색을 약간 회색으로 주어 눈에 띄게 함 */
    border: 1px solid #cbd5e1;
    color: #334155;      /* 글자색을 진하게 */
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    margin-right: 5px;   /* 홈 버튼과의 간격 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    transition: all 0.2s;
}

/* 다크 모드일 때 버튼 스타일 */
body.dark-mode .mode-toggle-btn {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

/* 헤더 내 버튼 정렬 */
.header-right {
    display: flex;
    align-items: center;
}

/* --- 본문 텍스트 주야간 색상 설정 --- */

body.dark-mode .verse-analysis-wrapper {
    background: #1e293b !important; /* 사이드바와 같은 어두운 네이비 */
    border-bottom: 1px dashed #334155 !important;
}

body.dark-mode .verse-analysis-container {
    background: #0f172a !important; /* 본문 배경보다 더 어두운 색 */
    border: 1px solid #334155 !important;
}
/* 탭 버튼 다크 모드 */
/* 활성화된 탭 버튼 */
body.dark-mode .v-tab-btn.active {
    background: #0f172a !important;
    color: #60a5fa !important;
    border-bottom: 2px solid #3b82f6 !important;
    font-weight: bold;
}

/* 탭 내부 컨텐츠 영역 */
body.dark-mode .v-tab-content {
    background: #0f172a !important;
    color: #e2e8f0 !important;
}

/* "데이터가 없습니다" 등 안내 문구 */
body.dark-mode .content-body {
    color: #cbd5e1 !important;
}

 

 

/* 탭 내부의 로딩/안내 텍스트 */
body.dark-mode .verse-analysis-container div {
    color: #94a3b8 !important;
}

/* 사용자 묵상 텍스트 영역 */
body.dark-mode .user-memo-area {
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid #334155;
}
/* =========================================================
   다크 모드(야간 모드) 전용: AI 데이터 토큰 스타일 보정
   (제미나이 핑크색, 젬마 노란색 모두 배경 제거 후 하얀색 테두리만 표시)
   ========================================================= */
body.dark-mode .has-ai-data,
body.dark-mode .has-notes-data {
    background: transparent !important;      /* 배경색 투명하게 처리 */
    border: 1px solid #e2e8f0 !important;    /* 눈이 부시지 않은 밝은 하얀색 계열 테두리 */
    border-radius: 4px !important;           /* 둥근 사각형 유지 */
}

/* AI 데이터와 노트 데이터가 동시에 있는 경우(그라데이션 배경)도 다크모드에서는 배경 제거 */
body.dark-mode .has-ai-data.has-notes-data {
    background: transparent !important;
    border: 1px solid #e2e8f0 !important;
}

/* 다크 모드에서 토큰에 마우스를 올렸을 때(Hover) 살짝 피드백만 주도록 수정 */
body.dark-mode .token-item.has-ai-data:hover,
body.dark-mode .token-item.has-notes-data:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}
/* =========================================================
   다크 모드(야간 모드) 전용: 선택된 토큰 스타일 보정
   (옅은 파란색 배경 제거 및 선명한 파란색 테두리만 표시)
   ========================================================= */
body.dark-mode .token-item.selected-word {
    background: transparent !important;      /* 배경색 투명하게 처리 */
    border: 1px solid #60a5fa !important;    /* 다크 모드에 잘 어울리는 밝은 파란색 테두리 */
    border-radius: 4px !important;           /* 둥근 사각형 테두리 유지 */
}

/* (선택 사항) 다크 모드에서 선택된 토큰에 마우스를 올렸을 때 살짝 반응만 주기 */
body.dark-mode .token-item.selected-word:hover {
    background: rgba(96, 165, 250, 0.1) !important; 
}
/* =========================================================
   다크 모드(야간 모드) 전용: 나의 주석 입력란 스타일 보정
   ========================================================= */
body.dark-mode .user-note-section textarea {
    color: #000000 !important; /* 타이핑하는 글자 색상을 검정색으로 강제 지정 */
}
/* =========================================================
   다크 모드(야간 모드): 주석 저장 후 색상 고정 (하얀바탕 방지)
   ========================================================= */
body.dark-mode .user-note-section textarea {
    /* 배경을 야간 모드 기본 어두운 색으로 고정 */
    background-color: var(--bg) !important; 
    
    /* 글자 색상을 야간 모드 기본 밝은 색으로 고정 */
    color: var(--fg) !important; 
    
    /* 테두리도 너무 밝지 않게 조정 */
    border: 1px solid var(--border) !important;
}

/* 입력 중(focus)일 때도 동일하게 유지 */
body.dark-mode .user-note-section textarea:focus {
    background-color: var(--bg) !important;
    color: var(--fg) !important;
    outline: none;
    border-color: var(--brand) !important; /* 포커스 시 브랜드 색상으로 포인트 */
}
/* =========================================================
   달력 (Calendar Modal) 스타일 설정 (화면 전체 크기 & 다중 일정 지원)
   ========================================================= */
.calendar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100000;
    display: none; justify-content: center; align-items: center; backdrop-filter: blur(3px);
}

/* 👇 크기를 화면 95%로 꽉 채우게 확대 */
.calendar-modal {
    background: var(--card); 
    width: 95%; max-width: 1400px; /* 기존 400px에서 대폭 확대 */
    height: 95vh; max-height: none; /* 화면 높이 95% 차지 */
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3); 
    display: flex; flex-direction: column;
    overflow: hidden; animation: popUp 0.3s ease-out; border: 1px solid var(--border);
}
@keyframes popUp { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.cal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.cal-nav-btn { background: none; border: none; font-size: 1.5rem; color: var(--muted); cursor: pointer; font-weight: bold; padding: 0 15px; }
.cal-nav-btn:hover { color: var(--brand); }
.cal-close-btn { background: none; border: none; font-size: 2rem; color: var(--muted); cursor: pointer; line-height: 1; }
.cal-close-btn:hover { color: #ef4444; }

.cal-weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr); text-align: center;
    padding: 12px 0; font-size: 1rem; font-weight: bold; border-bottom: 1px solid var(--border);
    background: var(--card); color: var(--fg);
}

/* 👇 칸의 높이를 유동적으로 늘리고 화면에 꽉 차게 변경 */
.cal-days {
    display: grid; grid-template-columns: repeat(7, 1fr); 
    grid-auto-rows: minmax(100px, 1fr); /* 칸의 최소 높이를 100px로 증가 */
    flex: 1; overflow-y: auto; background: var(--border); gap: 1px; /* 테두리 효과를 위해 gap 추가 */
}

/* 개별 날짜 셀 (일정이 20개 넘어가면 내부에서 스크롤 되도록 overflow-y 추가) */
/* 개별 날짜 셀 (안여백 8px -> 2px 대폭 축소로 글자 공간 최대 확보) */
.cal-day-cell {
    background: var(--card); padding: 2px; display: flex; flex-direction: column;
    align-items: flex-start; cursor: pointer; transition: background 0.2s; position: relative;
    overflow-y: auto; /* 일정이 많으면 스크롤 */
}
.cal-day-cell:hover { background: var(--bg); }

/* 날짜 숫자 여백 축소 (아래 여백 6px -> 0px) */
.cal-day-num { font-size: 0.95rem; font-weight: 700; color: var(--fg); margin-bottom: 0px; margin-left: 2px; }
.cal-day-cell.empty { background: var(--bg); cursor: default; }

.cal-day-cell.today {
    border: 2px solid var(--brand) !important;
    background: rgba(59, 130, 246, 0.05);
    z-index: 1; 
}
/* 오늘 날짜 동그라미 크기 및 여백 축소 */
.cal-day-cell.today .cal-day-num { 
    color: var(--brand); background: #eff6ff; border-radius: 50%; 
    width: 24px; height: 24px; 
    display: flex; justify-content: center; align-items: center; 
    margin: 0 0 0 0; 
}
body.dark-mode .cal-day-cell.today .cal-day-num { background: #1e3a8a; }

/* 일정 텍스트 (위아래 간격, 좌우 여백을 타이트하게 줄여서 최대한 많이 보이게) */
.cal-event-text {
    width: 100%; 
    font-size: 0.8rem; 
    font-weight: 600; 
    line-height: 1.1; /* 줄 간격을 더 타이트하게 */
    background: transparent; 
    border-radius: 4px; 
    padding: 0px 2px; /* 좌우 패딩을 2px로, 상하를 0px로 대폭 줄임 */
    margin-top: 0px; /* 네모칸과 네모칸 사이, 날짜와 네모칸 사이의 여백 제거 */
    text-indent: -0.5em; /* 점(•)과 텍스트 사이 간격 줄임 (들여쓰기 음수 값 조정) */
    padding-left: 0.5em; /* 들여쓰기만큼 왼쪽 여백 확보 */
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left;
    transition: 0.2s; cursor: pointer;
}
.cal-event-text:hover { background: rgba(0,0,0,0.05); }
body.dark-mode .cal-event-text:hover { background: rgba(255,255,255,0.1); }

/* 일정 등록 모달 내 10가지 컬러 피커 스타일 (기존과 동일) */
.color-picker-container { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.color-radio { display: none; }
.color-swatch {
    width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.color-radio:checked + .color-swatch {
    border-color: var(--fg);
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg);
}
/* =========================================================
   하단 SVG 아이콘 네비게이션 전용 스타일 (주/야간 완벽 대응)
   ========================================================= */
.bottom-nav {
    display: flex;
    justify-content: space-around; /* 4개 버튼을 동일한 간격으로 배치 */
    align-items: center;
}

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

.nav-btn {
    background: transparent !important; /* 브라우저 기본 흰색 배경 완벽 제거 */
    border: none;
    color: var(--fg); /* 야간모드(흰색계열), 주간모드(검정계열) 자동 전환 */
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.1s ease; /* 부드러운 전환 효과 */
}

/* 마우스(또는 터치)를 올렸을 때 살짝 배경이 깔리는 효과 */
.nav-btn:hover {
    background: var(--highlight) !important;
}

/* 터치/클릭 시 버튼이 살짝 눌리는 애니메이션 */
.nav-btn:active {
    transform: scale(0.92);
}

/* 캐시 삭제 버튼(빨간색) 전용 호버 효과 보정 */
#btn-delete-cache:hover {
    background: rgba(239, 68, 68, 0.1) !important; 
}
/* =========================================================
   절 단위 AI 해설(.verse-analysis-container) 내부 텍스트 정밀 제어
   ========================================================= */

/* 1. 기본 텍스트 (두께 및 진하기 설정) */
.verse-analysis-container .content-body,
.verse-analysis-container .v-tab-content {
    font-weight: 500; /* 일반 텍스트보다 살짝 더 두껍게 (가독성 향상) */
    color: #1e293b;   /* 주간 모드: 매우 짙은 남색/회색으로 선명하게 */
    line-height: 1.7; /* 줄 간격 최적화 */
    letter-spacing: -0.02em; /* 현대적인 자간 설정 */
}

/* 2. 강조 텍스트 (Bold 태그 및 Strong 태그) */
.verse-analysis-container b,
.verse-analysis-container strong {
    font-weight: 800; /* 매우 두껍게 설정하여 확실한 대비 제공 */
    color: #db2777;   /* 주간 모드: 사용자님이 선호하시는 딥 핑크 계열로 포인트 */
    background: linear-gradient(120deg, rgba(219, 39, 119, 0.1) 0%, rgba(219, 39, 119, 0) 100%); /* 살짝 형광펜 효과 */
    padding: 0 2px;
}

/* 3. 밑줄 텍스트 (Underline) - AI가 생성하는 주요 개념이나 목록 */
.verse-analysis-container u {
    text-decoration: none; /* 기본 촌스러운 밑줄 제거 */
    border-bottom: 2px solid #3b82f6; /* 현대적인 파란색 밑줄 적용 */
    font-weight: 700;
    padding-bottom: 1px;
}

/* 4. 목록 (리스트) 스타일링 - 사용자님의 "깔끔한 불릿 포인트" 선호 반영 */
.verse-analysis-container ul li {
    margin-bottom: 6px;
    position: relative;
}
.verse-analysis-container ul li::marker {
    color: #6366f1; /* 불릿 색상을 보라/파랑 계열로 변경 */
    font-weight: bold;
}

/* ----------------------------------------------- */
/* 다크 모드(야간 모드) 완벽 대응 */
/* ----------------------------------------------- */

/* 다크 모드: 기본 텍스트 */
body.dark-mode .verse-analysis-container .content-body,
body.dark-mode .verse-analysis-container .v-tab-content {
    font-weight: 400; /* 다크 모드에서는 빛 번짐을 막기 위해 두께를 살짝 낮춤 */
    color: #e2e8f0 !important; /* 밝고 부드러운 회백색 */
}

/* 다크 모드: 강조 텍스트 */
body.dark-mode .verse-analysis-container b,
body.dark-mode .verse-analysis-container strong {
    font-weight: 700;
    color: #f472b6 !important; /* 다크 모드용 밝은 핑크로 시인성 확보 */
    background: rgba(244, 114, 182, 0.15); /* 텍스트 배경을 은은하게 */
}

/* 다크 모드: 밑줄 텍스트 */
body.dark-mode .verse-analysis-container u {
    border-bottom: 2px solid #60a5fa !important; /* 다크 모드용 밝은 파란색 밑줄 */
    color: #f8fafc;
}
/* =========================================================
   단어 터치 시 올라오는 하단 분석 패널(updrop 메뉴) 다크 모드 완벽 대응
   ========================================================= */

/* 1. 패널 전체 배경 및 테두리 */
body.dark-mode #analysis-panel {
    background: #1e293b !important;
    border-top: 3px solid #6d28d9 !important; /* 다크모드용 은은한 보라색 테두리 */
    color: #f1f5f9 !important;
}

/* 2. 상단 정보창 (📍 마태복음 1장 1절 : 단어) */
body.dark-mode #selected-token-info span {
    background: #0f172a !important; /* 더 어두운 배경 */
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}
body.dark-mode #selected-token-info span b {
    color: #f472b6 !important; /* 단어 텍스트는 밝은 핑크색으로 시인성 확보 */
}

/* 3. 글자 크기 조절기(- / +) 배경 및 텍스트 */
body.dark-mode #analysis-panel > div:first-child > div > div {
    background: #0f172a !important;
    border-color: #334155 !important;
}
body.dark-mode #btn-ai-font-minus,
body.dark-mode #btn-ai-font-plus,
body.dark-mode #ai-font-level {
    color: #e2e8f0 !important;
}

/* 4. 기본 사전 의미 영역 (#v-basic-meaning) */
body.dark-mode #v-basic-meaning {
    border-bottom: 1px dashed #334155 !important;
    color: #e2e8f0 !important;
}
body.dark-mode #v-basic-meaning b {
    color: #a78bfa !important; /* 원어 제목 보라색 */
}
body.dark-mode #v-basic-meaning span[style*="color:#e91e63"] {
    color: #f472b6 !important; /* 스트롱 번호 핑크색 */
}

/* 5. AI 심층 해설 출력 박스 전체 (#v-ai-meaning) */
body.dark-mode #v-ai-meaning {
    background: #0f172a !important; /* 짙은 네이비 배경 */
    color: #e2e8f0 !important;
    border: 1px solid #334155 !important;
}

/* 6. 제미나이 / 노트 등 내부 동적 생성 박스 강제 색상 변환 */
/* 제미나이 박스 (원래 녹색 배경) */
body.dark-mode #v-ai-meaning div[style*="background:#f0fdf4"] {
    background: rgba(16, 185, 129, 0.1) !important; /* 투명도 있는 다크 녹색 */
    color: #e2e8f0 !important;
}
/* 노트 저장 박스 (원래 노란색 배경) */
body.dark-mode #v-ai-meaning div[style*="background:#fffbeb"] {
    background: rgba(245, 158, 11, 0.1) !important; /* 투명도 있는 다크 옐로우 */
    color: #e2e8f0 !important;
}

/* 7. 상태 및 에러 메시지 텍스트 색상 */
body.dark-mode #v-ai-meaning div {
    color: #e2e8f0 !important; /* 기본 글자는 밝게 */
}
body.dark-mode #v-ai-meaning div[style*="color:#2563eb"] {
    color: #60a5fa !important; /* '로딩 중' 파란색 텍스트 밝게 */
}
body.dark-mode #v-ai-meaning div[style*="color:#ef4444"] {
    color: #f87171 !important; /* '오류 발생' 빨간색 텍스트 밝게 */
}
/* =========================================================
   토큰 클릭 하단패널: 간단 문법 박스 주/야간 모드
   ========================================================= */
.token-grammar-box {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    line-height: 1.7;
    color: #334155;
}

.token-grammar-box b {
    color: #673ab7;
}

body.dark-mode .token-grammar-box {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .token-grammar-box b {
    color: #93c5fd !important;
}
#custom-hl-toolbar {
    display: none;
}
/* =========================================================
   야간모드: AI 심층 해설 (get_ollama_analysis_each.php) 흰색 바탕 강제 제거
   ========================================================= */

/* 외부 파일에서 동적으로 불러오는 모든 내부 요소의 하얀색 배경을 투명하게 뚫어버립니다 */
body.dark-mode #v-ai-meaning div,
body.dark-mode #v-ai-meaning p,
body.dark-mode #v-ai-meaning span,
body.dark-mode #v-ai-meaning table,
body.dark-mode #v-ai-meaning th,
body.dark-mode #v-ai-meaning td {
    background-color: transparent !important; /* 인라인 흰색 배경 완벽 무력화 */
    color: #e2e8f0 !important;                /* 글자는 선명하고 눈이 편한 회백색으로 강제 고정 */
    border-color: #334155 !important;         /* 표나 테두리가 있을 경우 어두운 색으로 조화롭게 */
}

/* 
  주의: 위에서 모두 투명하게 만들었으므로, 
  기존에 설정하셨던 제미나이(녹색) & 노트(노란색) 특수 박스는 
  원래의 다크모드 전용 컬러를 유지하도록 다시 예외 처리해 줍니다. 
*/
body.dark-mode #v-ai-meaning div[style*="background:#f0fdf4"],
body.dark-mode #v-ai-meaning div[style*="background-color: #f0fdf4"],
body.dark-mode #v-ai-meaning div[style*="background-color:#f0fdf4"] {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

body.dark-mode #v-ai-meaning div[style*="background:#fffbeb"],
body.dark-mode #v-ai-meaning div[style*="background-color: #fffbeb"],
body.dark-mode #v-ai-meaning div[style*="background-color:#fffbeb"] {
    background-color: rgba(245, 158, 11, 0.1) !important;
}
/* 달력 모달 내부 슬라이더 구조 */
.calendar-modal {
    width: 90vw; /* 화면 너비의 90%로 고정 */
    max-width: 400px;
    height: 80vh;
    margin: 0 auto;
    background: var(--card);
    border-radius: 20px;
    overflow: hidden; /* 내부 슬라이더가 삐져나오지 않게 */
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

/* 2. 슬라이더 컨테이너: 모달 너비의 정확히 2배(200%)로 설정 */

/* 4. 메모 페이지 내부 여백 */
.memo-page {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    background: var(--bg);
}
/* 5. 요일 및 날짜 셀이 찌그러지지 않도록 설정 */
.cal-weekdays, .cal-days {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important; /* 7열 고정 */
    width: 100% !important;
}

.cal-day-cell {
    min-width: 0 !important; /* flex 아이템 압축 방지 */
}
 

.memo-page h3 {
    color: var(--brand);
    margin-top: 0;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

#memoTextarea {
    flex-grow: 1;
    width: 100%;
    background: var(--card);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    font-size: 1rem;
    resize: none;
    outline: none;
    margin-bottom: 15px;
    font-family: inherit;
}

#memoTextarea:focus {
    border-color: var(--brand);
}

.memo-btn-group {
    display: flex;
    gap: 10px;
}

.memo-save-btn {
    flex: 1;
    background: var(--brand);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.memo-back-btn {
    flex: 1;
    background: var(--border);
    color: var(--fg);
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}
