h1 {
    margin: 0.1rem 0 0.3rem 0;
    font-size: 1.2rem;
}

h2 {
    margin: 0.5rem 0 0.3rem 0;
    font-size: 1.2rem;
    font-weight: bold;
}


.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin: 1rem 0 0 0;
    padding: 0.1rem 0.5rem;
    background-color: hsl(212, 90%, 80%);
    border-radius: 1rem 1rem 0 0;
}

.doc-source {
    font-size: 0.8rem;
    font-weight: normal;
    /* background-color: hsl(212, 90%, 88%); */
    padding: 0.2rem 0.5rem;
    border-radius: 0 0 0 0;
    text-align: right;
}

.doc-content {
    margin: 0 0 0 0;
    font-size: 0.8rem;
    font-weight: normal;
    background-color: hsl(212, 90%, 88%);
    padding: 0.2rem 0.5rem;
    border-radius: 0 0 1rem 1rem;
}

p {
    margin: .3em 0 1em 0;
}

/* Admin controls styling */
.admin-controls {
    margin: 1rem 0;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
}

.admin-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.admin-button:hover {
    background-color: #0056b3;
}

.admin-button:disabled {
    background-color: #28a745;
    cursor: not-allowed;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

ul {
    margin: 1em 0 1em 0;
}

.layout { 
    display: flex; 
    flex: 1;
    gap: 0px;
    padding: 0px;
    box-sizing: border-box;
    min-height: 0;
}

.sidebar { 
    min-width: 365px;
    width: 40%; 
    padding: 0;
    background: white;
    display: flex;
    flex-direction: column;
    position: relative;
}

#last-update {
    font-size: 0.9em;
    color: #64748b;
    padding: 0;
    display: flex;
    align-items: center;
}

#entries-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.entry-list { 
    flex: 1;
    padding: 0;
    margin: 0;
    list-style: none;
    overflow-y: auto;
}

.entry-item { 
    cursor: pointer; 
    padding: 2px 8px;
    margin: 0;
    background: #f2f6fc;
    color: rgb(32,33,36);
    box-shadow: inset 0 -1px 0 0 rgba(100,121,143,0.12);
    border-bottom: 0.5px solid #e2e8f0;
    transition: all 0.2s ease;
    position: relative;
}

.entry-item:hover { 
    background: #e2e8f0;
    box-shadow: inset 1px 0 0 #dadce0,inset -1px 0 0 #dadce0,0 1px 2px 0 rgba(60,64,67,.3),0 1px 3px 1px rgba(60,64,67,.15);
    z-index: 1;
}

.entry-item.selected { 
    background: #e0f2fe;
}

.pagination { 
    margin: 0;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    margin-bottom: 0;
}

.pagination button { 
    padding: 10px 16px;
    font-size: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.pagination button:hover:not(:disabled) { 
    background: #f8fafc;
    border-color: #94a3b8;
}

.pagination button:disabled { 
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    font-size: 16px;
    color: #64748b;
}

.content-panel {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.content, .retrieved-docs {
    background: #f8fafc;
}

.content table, .retrieved-docs table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.content th, .retrieved-docs th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 600;
    padding: 12px;
    text-align: left;
    border: 1px solid #e2e8f0;
}

.content td, .retrieved-docs td {
    padding: 12px;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.content tr:nth-child(even), .retrieved-docs tr:nth-child(even) {
    background: #f8fafc;
}

.content blockquote, .retrieved-docs blockquote {
    border-left: 4px solid #94a3b8;
    margin: 15px 0;
    padding: 10px 20px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 0 8px 8px 0;
}

.content ul, .content ol,
.retrieved-docs ul, .retrieved-docs ol {
    padding-left: 20px;
}

.content li, .retrieved-docs li {
    margin: 0;
    color: #475569;
}

.content-panel .content,
.content-panel .retrieved-docs {
    margin: 0;
    padding: 0;
    background: #e0f2fe;
}

#content-container {
    padding: 2%;
    background: #e0f2fe;
}

/* Top-right meta area inside content container */
#content-container .content-meta {
    display: flex;
    justify-content: flex-end;
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

#content-container .record-timestamp {
    white-space: nowrap;
}

/* Code block styling */
.hljs {
    position: relative;
    background: #1e293b !important;
    color: #e2e8f0 !important;
    padding: 15px !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    animation: none !important;
    transition: none !important;
}

.hljs * {
    animation: none !important;
    transition: none !important;
}

.sidebar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
    border-top: 1px solid #e2e8f0;
    background: white;
    margin-top: auto;
}

.sidebar-footer #last-update {
    padding: 0;
    display: flex;
    align-items: center;
}

/* 미니멀 네비게이션 바 스타일 */
.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1000;
}

.nav-links {
    display: flex;
    /* gap: 0.5rem; */ /* Safari 호환성을 위해 gap 대신 마진 사용 */
    align-items: center;
}

.nav-link + .nav-link {
    margin-left: 0.5rem;
}

.nav-link {
    display: inline-block; /* Safari에서 스타일 적용을 위해 추가 */
    padding: 10px 16px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    position: relative;
    letter-spacing: 0.25px;
}


.nav-link:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-link:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 활성 메뉴 링크 스타일 */
.nav-link.active {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
    font-weight: 600;
}

.nav-search {
    display: flex;
    align-items: center;
    margin: 0 1rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-update {
    font-weight: 500;
}

#logout-container {
    display: flex;
    justify-content: flex-end;
}

#logout-container button {
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    letter-spacing: 0.25px;
}

#logout-container button:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#logout-container button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 브랜드 로고 영역 */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #111827;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-brand:hover {
    color: #374151;
    transform: scale(1.02);
}

.nav-brand-icon {
    width: 28px;
    height: 28px;
    background: #f3f4f6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.nav-brand:hover .nav-brand-icon {
    background: #e5e7eb;
    transform: rotate(2deg);
}

.nav-brand-text {
    font-weight: 700;
    letter-spacing: 0.25px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .nav-content {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .nav-links {
        gap: 0.25rem;
        flex-wrap: wrap;
        justify-content: center;
        flex: 1;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
        flex: 1;
        min-width: 0;
        text-align: center;
    }
    
    
    .nav-search {
        width: 100%;
        order: 2;
        margin: 0.5rem 0;
    }
    
    .nav-search input {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .nav-right {
        gap: 0.75rem;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        order: 3;
    }
    
    .nav-update {
        font-size: 0.8em;
        padding: 4px 8px;
        flex: 1;
        text-align: center;
    }
    
    #logout-container {
        flex: 1;
        justify-content: center;
    }
    
    #logout-container button {
        padding: 6px 12px;
        font-size: 12px;
        width: 100%;
        max-width: 100px;
    }
    
    .nav-brand {
        font-size: 16px;
        order: 1;
        flex: 1;
        justify-content: center;
    }
    
    .nav-brand-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .nav-content {
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-brand {
        font-size: 16px;
        order: 1;
        width: 100%;
        justify-content: center;
    }
    
    .nav-brand-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .nav-links {
        justify-content: center;
        width: 100%;
        order: 2;
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
        flex: 1;
        min-width: 0;
        text-align: center;
    }
    
    .nav-right {
        justify-content: center;
        width: 100%;
        order: 3;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-update {
        font-size: 0.8em;
        padding: 6px 12px;
        width: 100%;
        text-align: center;
    }
    
    #logout-container {
        width: 100%;
        justify-content: center;
    }
    
    #logout-container button {
        padding: 8px 16px;
        font-size: 13px;
        width: 100%;
        max-width: 120px;
    }
}

/* 매우 작은 화면을 위한 추가 최적화 */
@media (max-width: 320px) {
    .nav-content {
        padding: 0.25rem;
    }
    
    .nav-link {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .nav-brand {
        font-size: 14px;
    }
    
    .nav-brand-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .nav-update {
        font-size: 0.7em;
        padding: 4px 8px;
    }
    
    #logout-container button {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* 로그인 페이지 스타일 - 미니멀 디자인 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.login-container {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.login-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-input {
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    transition: all 0.3s ease;
    outline: none;
}

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

.login-input.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.login-button {
    padding: 1.25rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: #1e293b;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-button:hover {
    background: #334155;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.15);
}

.login-button:active {
    transform: translateY(0);
}

.error-message {
    color: #ef4444;
    font-size: 0.95rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

@media (max-width: 480px) {
    .login-container {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
    
    .login-title {
        font-size: 2rem;
    }
}
