/* Custom styles for WENIV Presenter */

/* Font faces */
@font-face {
    font-family: 'BMJUA';
    src: url('../../font/BMJUA_ttf.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BMHANNA';
    src: url('../../font/BMHANNAAir_ttf.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BMDOHYEON';
    src: url('../../font/BMDOHYEON_ttf.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BMYEONSUNG';
    src: url('../../font/BMYEONSUNG_ttf.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BMEULJIROT';
    src: url('../../font/BMEULJIROTTF.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'MaruBuri';
    src: url('../../font/MaruBuri-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'D2Coding';
    src: url('../../font/D2Coding-Ver1.3.2-20180524-ligature.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BMHANNAPro';
    src: url('../../font/BMHANNAPro.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BMHANNA11yrs';
    src: url('../../font/BMHANNA_11yrs_ttf.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BMKIRANGHAERANG';
    src: url('../../font/BMKIRANGHAERANG-TTF.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BMEuljiro10yearslater';
    src: url('../../font/BMEuljiro10yearslater.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BMEuljirooraeorae';
    src: url('../../font/BMEuljirooraeorae.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'NanumBarunGothic';
    src: url('../../font/NanumBarunGothic.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'NanumBarunpen';
    src: url('../../font/NanumBarunpenR.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'NanumGothic';
    src: url('../../font/NanumGothic.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'NanumSquare';
    src: url('../../font/NanumSquareR.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}




/* Dark mode styles - now handled by Tailwind classes in HTML */


/* Help modal responsive and accessibility styles */
/* Help modal - convert to Tailwind */
#help-modal {
    backdrop-filter: blur(4px);
}

.help-accordion-btn:focus {
    @apply outline-2 outline-blue-600 outline-offset-2;
}

.help-accordion-icon.rotated {
    @apply rotate-180;
}


/* Help modal animations */
.help-accordion-content {
    @apply transition-all duration-300 ease-out max-h-0 overflow-hidden;
}

.help-accordion-content.open {
    max-height: 2000px;
}

.help-accordion-content .font-mono {
    @apply font-mono;
}

/* Dark mode form elements - now handled by Tailwind classes */

/* Webkit scrollbar styling */
#slide-container::-webkit-scrollbar {
    width: 6px;
}

#slide-container::-webkit-scrollbar-track {
    background: transparent;
}

#slide-container::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

#slide-container::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.8);
}

/* Dark mode scrollbar */
.dark #slide-container::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.5);
}

.dark #slide-container::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.8);
}

/* Heading font sizes - hierarchical scaling */
#slide-content h1 {
    font-size: 4rem; /* Reduced from 5rem */
    line-height: 1.3; /* 줄간격 개선 */
    font-weight: 700;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem; /* 제목 아래 여백 확대 */
    margin-top: 0;
}

#slide-content h2 {
    font-size: 3.5rem; /* Reduced from 4rem */
    line-height: 1.35; /* 줄간격 개선 */
    font-weight: 600;
    color: #1f2937;
    margin-top: 2.5rem; /* 제목 위 여백 확대 */
    margin-bottom: 1.5rem; /* 제목 아래 여백 확대 */
}

#slide-content h3 {
    font-size: 3.2rem; /* Reduced from 3.5rem */
    line-height: 1.4; /* 줄간격 개선 */
    font-weight: 600;
    color: #374151;
    margin-top: 2rem; /* 제목 위 여백 확대 */
    margin-bottom: 1rem; /* 제목 아래 여백 확대 */
}

#slide-content h4 {
    font-size: 2.9rem; /* Reduced from 3rem */
    line-height: 1.35;
    font-weight: 600;
    color: #4b5563;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

#slide-content h5 {
    font-size: 2.7rem; /* Between h4 and base text */
    line-height: 1.4;
    font-weight: 600;
    color: #6b7280;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

#slide-content h6 {
    font-size: 2.5rem; /* Same as base text */
    line-height: 1.4;
    font-weight: 600;
    color: #6b7280;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

#slide-content p {
    font-size: 2.5rem; /* Reduced from 3rem */
    line-height: 1.8; /* 줄간격 개선 */
    margin-bottom: 0.5rem; /* Reduced from 1.5rem */
}

/* 마지막 p 태그의 하단 여백 제거 */
#slide-content p:last-child {
    margin-bottom: 0;
}

/* 단일 p 태그만 있을 때 하단 여백 제거 */
#slide-content p:only-child {
    margin-bottom: 0;
}

/* 슬라이드의 마지막 요소 하단 여백 */
#slide-content > *:last-child {
    margin-bottom: 2rem;
}

/* 빈 p 태그 숨기기 (중앙 정렬 시 생성되는 빈 태그 처리) */
#slide-content p:empty {
    display: none;
    margin: 0;
    padding: 0;
    height: 0;
    line-height: 0;
}

/* 공백만 있는 p 태그 처리 */
#slide-content p {
    min-height: 0;
}

/* 빈 p 태그가 인라인 스타일을 가지고 있어도 숨기기 */
#slide-content p[style]:empty {
    display: none;
}

/* text-center 내부의 빈 p 태그 처리 */
.text-center p:empty {
    display: none;
}

/* br 태그만 있는 p 태그 처리 - 높이 제한 제거 */
#slide-content p:has(br):not(:has(text)) {
    margin: 0;
    padding: 0;
}

/* Dark mode heading colors */
.dark #slide-content h1 {
    border-bottom-color: #4b5563;
    color: #f9fafb;
}

.dark #slide-content h2 {
    color: #f3f4f6;
}

.dark #slide-content h3 {
    color: #d1d5db;
}

.dark #slide-content h4 {
    color: #9ca3af;
}

.dark #slide-content h5,
.dark #slide-content h6 {
    color: #9ca3af;
}

.dark #slide-content p {
    color: #e5e7eb;
}

/* Code blocks */
#slide-content pre {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: visible; /* Changed from auto to visible */
    overflow-wrap: break-word; /* Break long words */
    white-space: pre-wrap; /* Wrap text instead of horizontal scroll */
    word-break: break-word; /* Break words at any point if needed */
    margin: 1rem 0;
    font-size: 0.7em; /* Consistent code block size */
    font-family: 'Courier New', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
}

.dark #slide-content pre {
    background-color: #1e293b;
    border-color: #475569;
}

#slide-content code {
    background-color: #f1f5f9;
    color: #dc2626;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.7em; /* Consistent with Prism code blocks */
    font-family: 'Courier New', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; /* Use monospace font */
}

.dark #slide-content code {
    background-color: #334155;
    color: #fca5a5;
}

#slide-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    font-size: 1em; /* Use parent pre font-size */
}

/* Links/Anchor tags */
#slide-content a {
    color: #2563eb; /* Blue color for links */
    text-decoration: none; /* Remove underline */
    transition: color 0.2s ease;
}

#slide-content a:hover {
    color: #1d4ed8; /* Darker blue on hover */
    text-decoration: underline; /* Show underline on hover */
}

.dark #slide-content a {
    color: #60a5fa; /* Light blue for dark mode */
}

.dark #slide-content a:hover {
    color: #93bbfc; /* Lighter blue on hover in dark mode */
    text-decoration: underline; /* Show underline on hover in dark mode */
}

/* Code block font size adjustment */
code[class*=language-], 
pre[class*=language-] {
    font-size: 0.7em;
    font-family: 'Courier New', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    overflow-wrap: break-word !important; /* Force word wrap in Prism blocks */
    white-space: pre-wrap !important; /* Wrap text in Prism blocks */
    word-break: break-word !important; /* Break words if needed */
}

/* Mobile code font size adjustment */
@media (max-width: 768px) {
    #slide-content code {
        font-size: 0.8rem !important; /* 모바일에서 고정 크기 */
    }
    
    #slide-content pre {
        font-size: 0.75rem !important; /* 모바일에서 고정 크기 */
    }
    
    #slide-content pre code {
        font-size: inherit !important; /* pre 태그의 크기 상속 */
    }
    
    code[class*=language-], 
    pre[class*=language-] {
        font-size: 0.75rem !important; /* Prism 코드 블록도 고정 크기 */
    }
}

@media (max-width: 480px) {
    #slide-content code {
        font-size: 0.7rem !important; /* 소형 모바일에서 더 작게 */
    }
    
    #slide-content pre {
        font-size: 0.65rem !important; /* 소형 모바일에서 더 작게 */
    }
    
    code[class*=language-], 
    pre[class*=language-] {
        font-size: 0.65rem !important; /* 소형 모바일 Prism 코드 블록 */
    }
}

/* Images */
#slide-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 0 auto;
    display: block;
    flex-shrink: 0; /* 이미지 크기 유지 */
}

/* Fix flex layout for image + source combination */
.text-center img {
    margin-bottom: 0.5rem;
}

.text-center .text-highlight {
    display: inline;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Lists */
#slide-content ul, #slide-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

#slide-content ul {
    list-style-type: disc;
}

#slide-content ol {
    list-style-type: decimal;
}

#slide-content ul ul {
    list-style-type: circle;
}

#slide-content ul ul ul {
    list-style-type: square;
}

#slide-content ol ol {
    list-style-type: lower-alpha;
}

#slide-content ol ol ol {
    list-style-type: lower-roman;
}

#slide-content li {
    margin: 0.8rem 0; /* 리스트 아이템 간격 확대 */
    display: list-item;
    list-style-position: outside;
    font-size: 2.5rem; /* Reduced from 3rem */
    line-height: 1.8; /* 줄간격 개선 */
}

/* 리스트 아이템 내부의 이미지 */
#slide-content li img {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Override prose styles that might remove list markers */
.prose ul li,
.prose ol li {
    list-style: inherit;
    display: list-item;
    margin: 0.5rem 0;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

/* Blockquotes */
#slide-content blockquote {
    border-left: 4px solid #3b82f6;
    background-color: #eff6ff;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

.dark #slide-content blockquote {
    border-left-color: #60a5fa;
    background-color: #1e3a8a;
    color: #dbeafe;
}

/* Tables */
#slide-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    border: 1px solid #e5e7eb;
}

.dark #slide-content table {
    border-color: #4b5563;
}

#slide-content th,
#slide-content td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}

.dark #slide-content th,
.dark #slide-content td {
    border-color: #4b5563;
}

#slide-content th {
    background-color: #f9fafb;
    font-weight: 600;
}

.dark #slide-content th {
    background-color: #374151;
}

/* Fullscreen mode - use Tailwind classes in JS */
.fullscreen {
    background-color: white !important;
}

/* dark mode and fullscreen styles */
.dark .fullscreen {
    background-color: #111827 !important; /* Dark mode background */
}

/* Fullscreen API native mode - very high specificity to override Tailwind */
body #presentation-section #slide-container:fullscreen,
body #slide-container:fullscreen,
body #slide-container:-webkit-full-screen,
body #slide-container:-moz-full-screen,
body #slide-container:-ms-fullscreen {
    background-color: #ffffff;
}

body.dark #presentation-section #slide-container:fullscreen,
body.dark #slide-container:fullscreen,
body.dark #slide-container:-webkit-full-screen,
body.dark #slide-container:-moz-full-screen,
body.dark #slide-container:-ms-fullscreen {
    background-color: #111827;
}

/* Fallback fullscreen mode for browsers without fullscreen API */
body #slide-container.fullscreen-fallback {
    background-color: #ffffff;
}

body.dark #slide-container.fullscreen-fallback {
    background-color: #111827;
}


/* Slide transitions */
.slide-enter {
    @apply translate-x-full opacity-0;
}

.slide-enter-active {
    @apply translate-x-0 opacity-100 transition-all duration-300 ease-out;
}

.slide-exit {
    @apply translate-x-0 opacity-100;
}

.slide-exit-active {
    @apply -translate-x-full opacity-0 transition-all duration-300 ease-out;
}

/* mermaid scale 조정 */
.mermaid {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible; /* Changed from auto to visible to prevent scrollbars */
    max-width: 90%; /* Reduced to give breathing room */
    margin: 2rem auto;
    font-size: 1.2em; /* Increase mermaid text size */
}

.mermaid > svg {
    max-width: 85%; /* Reduced to prevent overflow */
    height: auto;
    transform: scale(1); /* Removed scaling to prevent overflow */
    transform-origin: center;
    margin: 1rem 0;
}

/* Container for mermaid to prevent overflow */
.mermaid-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 1rem;
    overflow: hidden; /* Hide any overflow */
}

.mermaid-container .mermaid {
    max-width: 100%;
    overflow: visible;
}

.mermaid-container svg {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
}


/* Presentation mode adjustments for all devices */
#presentation-section {
    /* Force landscape orientation for better presentation viewing */
    position: relative;
}

/* Remove forced landscape mode - let mobile users view in portrait naturally */

/* Hide footer in presentation mode for all devices */
body:has(#presentation-section:not(.hidden)) .footer-container {
    display: none;
}

/* Keep header visible in presentation mode on mobile */
@media (max-width: 768px) {
    #presentation-section header {
        display: flex;
    }
}

/* Adjust presentation layout for mobile with header */
@media (max-width: 768px) {
    #presentation-section #slide-container {
        position: fixed;
        top: 60px; /* Account for header height */
        left: 0;
        width: 100vw;
        height: calc(100vh - 60px); /* Subtract header height */
        padding: 0;
        padding-bottom: 100px; /* 컨트롤 버튼 공간 확보 */
        z-index: 999;
        background: white;
        overflow-y: auto !important; /* 세로 스크롤 활성화 */
        -webkit-overflow-scrolling: touch !important; /* iOS 부드러운 스크롤 */
    }

    .dark #presentation-section #slide-container {
        background: #111827;
    }
}

/* Desktop presentation mode - normal layout */
@media (min-width: 769px) {
    #presentation-section #slide-container {
        position: relative;
        width: 100%;
        height: auto;
        min-height: calc(100vh - 200px);
        padding: 2rem;
        background: transparent;
    }
}

/* Mobile styles - remove box styling from slide-content */
@media (max-width: 768px) {
    #slide-content {
        box-shadow: none !important;
        border: none !important;
    }
    
    /* Expand content area to full slide-container on mobile */
    #slide-container {
        padding: 0 !important;
        padding-top: 2rem !important; /* 모바일에서 상단 여백 추가 */
        padding-bottom: 100px !important; /* 컨트롤 버튼 공간 확보 */
        overflow-y: auto !important; /* 세로 스크롤 활성화 */
        -webkit-overflow-scrolling: touch !important; /* iOS 부드러운 스크롤 */
    }
    
    #slide-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 2rem !important;
        min-height: auto !important; /* 고정 높이 제거 */
        height: auto !important; /* 컨텐츠에 따라 높이 자동 조정 */
    }
}

/* Bottom navigation always visible in presentation */
#presentation-section #bottom-nav-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
}

/* Force bottom navigation to be visible on mobile in presentation */
@media (max-width: 768px) {
    #presentation-section #bottom-nav-container {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 99999;
        display: flex;
        opacity: 1;
        visibility: visible;
    }
    
    /* Hide unnecessary buttons on mobile */
    #presentation-section #pdf-export-btn,
    #presentation-section #markdown-export-btn,
    #presentation-section #fullscreen-toggle {
        display: none;
    }
    
    /* Ensure navigation container is always visible on mobile */
    #bottom-nav-container {
        position: fixed;
        bottom: 20px; /* 바닥과의 간격 */
        left: 50%;
        transform: translateX(-50%);
        z-index: 99999;
        display: flex;
        opacity: 1;
        visibility: visible;
        pointer-events: auto; /* 터치 이벤트 활성화 */
    }
    
    /* Hide logo on mobile with stronger rules */
    #presentation-logo,
    #presentation-section #presentation-logo {
        display: none;
        visibility: hidden;
        opacity: 0;
    }
}

/* Hide elements on mobile */
@media (max-width: 640px) {
    #local-file-fields {
        display: none;
    }
    
    /* Show mobile info text only on mobile */
    .mobile-only-info {
        display: block;
    }
    
    /* Show footer on mobile welcome screen but hide in presentation */
    body:has(#presentation-section.hidden) .footer-container {
        display: flex;
    }
    
    body:has(#presentation-section:not(.hidden)) .footer-container {
        display: none;
    }
    
    /* Hide specific buttons on mobile */
    #pdf-export-btn,
    #markdown-export-btn,
    #fullscreen-toggle {
        display: none;
    }
    
    /* Hide logo on mobile */
    #presentation-logo {
        display: none;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    /* Add left margin to header logo on mobile */
    header .flex.items-center h1 {
        margin-left: 0.5rem;
    }
    
    #slide-container {
        padding: 1rem;
    }
    
    #slide-content {
        padding: 1.5rem;
        font-size: 1.5rem; /* 150% of base for mobile */
        line-height: 1.7; /* 모바일 줄간격 조정 */
        min-height: calc(100vh - 160px) !important; /* 헤더와 버튼 영역 제외한 최소 높이 */
        height: auto !important; /* 컨텐츠에 따라 높이 자동 조정 */
        max-width: 100% !important; /* 전체 너비 사용 */
        margin: 0 !important; /* 여백 제거 */
        box-shadow: none !important; /* 그림자 제거 */
        border: none !important; /* 테두리 제거 */
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important; /* 상단 정렬로 변경 */
    }
    
    #slide-content h1 {
        font-size: 2.5rem; /* Proportionally reduced */
        line-height: 1.3;
    }
    
    #slide-content h2 {
        font-size: 2.2rem; /* Proportionally reduced */
        line-height: 1.35;
    }
    
    #slide-content h3 {
        font-size: 1.9rem; /* Proportionally reduced */
        line-height: 1.4;
    }
    
    #slide-content h4 {
        font-size: 1.7rem; /* Proportionally reduced */
        line-height: 1.4;
    }
    
    #slide-content h5 {
        font-size: 1.5rem; /* Proportionally reduced */
        line-height: 1.5;
    }
    
    #slide-content h6 {
        font-size: 1.3rem; /* Proportionally reduced */
        line-height: 1.5;
    }
    
    #slide-content p {
        font-size: 1.3rem; /* Proportionally reduced */
        line-height: 1.7;
    }
    
    #slide-content li {
        font-size: 1.3rem; /* Proportionally reduced */
        line-height: 1.7;
    }
    
    .text-center {
        font-size: 1.3rem; /* 모바일 센터 텍스트 조정 - proportionally reduced */
    }
    
    #slide-nav {
        top: 10px;
        right: 10px;
        scale: 0.9;
    }
    
    /* 홈 버튼이 bottom-nav-container 안에 있으므로 절대 위치 지정 제거 */
    /* #home-button {
        top: 10px;
        left: 10px;
        scale: 0.9;
    } */
    
    #fullscreen-toggle {
        top: 10px;
        left: 52px;
        scale: 0.9;
    }
}

@media (max-width: 480px) {
    #slide-content {
        padding: 1rem;
        font-size: 1.25rem; /* 125% of base for small mobile */
        line-height: 1.6; /* 소형 모바일 줄간격 조정 */
        min-height: calc(100vh - 160px) !important; /* 헤더와 버튼 영역 제외한 최소 높이 */
        height: auto !important; /* 컨텐츠에 따라 높이 자동 조정 */
        max-width: 100% !important; /* 전체 너비 사용 */
        margin: 0 !important; /* 여백 제거 */
        box-shadow: none !important; /* 그림자 제거 */
        border: none !important; /* 테두리 제거 */
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important; /* 상단 정렬로 변경 */
    }
    
    #slide-content h1 {
        font-size: 2rem; /* Proportionally reduced */
        line-height: 1.3;
    }
    
    #slide-content h2 {
        font-size: 1.75rem; /* Proportionally reduced */
        line-height: 1.35;
    }
    
    #slide-content h3 {
        font-size: 1.6rem; /* Proportionally reduced */
        line-height: 1.4;
    }
    
    #slide-content h4 {
        font-size: 1.45rem; /* Proportionally reduced */
        line-height: 1.4;
    }
    
    #slide-content h5 {
        font-size: 1.3rem; /* Proportionally reduced */
        line-height: 1.5;
    }
    
    #slide-content h6 {
        font-size: 1.15rem; /* Proportionally reduced */
        line-height: 1.5;
    }
    
    #slide-content p {
        font-size: 1.1rem; /* Proportionally reduced */
        line-height: 1.6;
    }
    
    #slide-content li {
        font-size: 1.1rem; /* Proportionally reduced */
        line-height: 1.6;
    }
    
    .text-center {
        font-size: 1.1rem; /* 소형 모바일 센터 텍스트 조정 - proportionally reduced */
    }
}

/* Print styles */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    /* Force light mode styles for PDF printing */
    body {
        background-color: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .dark {
        background-color: white !important;
        color: black !important;
    }
    
    /* Ensure fonts are embedded properly */
    @font-face {
        font-family: 'BMJUA';
        src: url('/font/BMJUA_ttf.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
    }
    
    @font-face {
        font-family: 'BMHANNA';
        src: url('../../font/BMHANNAAir_ttf.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
    }
    
    @font-face {
        font-family: 'BMDOHYEON';
        src: url('../../font/BMDOHYEON_ttf.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
    }
    
    @font-face {
        font-family: 'BMYEONSUNG';
        src: url('../../font/BMYEONSUNG_ttf.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
    }
    
    @font-face {
        font-family: 'BMEULJIROT';
        src: url('../../font/BMEULJIROTTF.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
    }
    
    @font-face {
        font-family: 'MaruBuri';
        src: url('../../font/MaruBuri-Regular.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
    }
    
    header,
    #slide-nav,
    #fullscreen-toggle,
    #home-button,
    #file-nav-toggle,
    #pdf-export-btn,
    #file-nav-sidebar,
    #bottom-nav-container {
        display: none !important;
    }
    
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }
    
    #slide-container {
        padding: 0 !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
    }
    
    #slide-content {
        box-shadow: none !important;
        border: none !important;
        page-break-inside: avoid;
        break-inside: avoid;
        margin: 0 !important;
        padding: 1.5cm !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 90vh !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        background: white !important;
    }
    
    /* PDF용 모든 슬라이드 컨테이너 */
    .pdf-slide {
        page-break-before: always;
        page-break-inside: auto;
        break-inside: auto;
        width: 100% !important;
        height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 2cm !important;
        padding-bottom: 3cm !important;
        margin: 0 !important;
        background: white !important;
        color: black !important;
        position: relative !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }
    
    .pdf-slide:first-child,
    .pdf-slide-first {
        page-break-before: auto !important;
        margin-top: 0 !important;
    }
    
    /* PDF slide content container */
    .pdf-slide-content {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        overflow: visible !important;
    }
    
    /* PDF 폰트 상속 (코드 블록 제외) */
    .pdf-slide,
    .pdf-slide *:not(code):not(pre):not([class*="language-"]):not(.token) {
        color: black !important;
    }
    
    .pdf-slide.font-family-bmjua,
    .pdf-slide.font-family-bmjua *:not(code):not(pre):not([class*="language-"]):not(.token) {
        font-family: 'BMJUA', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    }
    
    .pdf-slide.font-family-bmhanna,
    .pdf-slide.font-family-bmhanna *:not(code):not(pre):not([class*="language-"]):not(.token) {
        font-family: 'BMHANNA', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    }
    
    .pdf-slide.font-family-bmdohyeon,
    .pdf-slide.font-family-bmdohyeon *:not(code):not(pre):not([class*="language-"]):not(.token) {
        font-family: 'BMDOHYEON', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    }
    
    .pdf-slide.font-family-bmyeonsung,
    .pdf-slide.font-family-bmyeonsung *:not(code):not(pre):not([class*="language-"]):not(.token) {
        font-family: 'BMYEONSUNG', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    }
    
    .pdf-slide.font-family-bmeuljirot,
    .pdf-slide.font-family-bmeuljirot *:not(code):not(pre):not([class*="language-"]):not(.token) {
        font-family: 'BMEULJIROT', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    }
    
    .pdf-slide.font-family-maruburi,
    .pdf-slide.font-family-maruburi *:not(code):not(pre):not([class*="language-"]):not(.token) {
        font-family: 'MaruBuri', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    }
    
    .pdf-slide.font-family-default,
    .pdf-slide.font-family-default *:not(code):not(pre):not([class*="language-"]):not(.token) {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    }
    
    /* PDF slide 내용이 넘치지 않을 때 세로 중앙 정렬 */
    .pdf-slide-content-wrapper {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        flex-grow: 1 !important;
    }
    
    /* 내용이 많을 때는 상단 정렬 */
    .pdf-slide-content-wrapper.content-overflow {
        justify-content: flex-start !important;
        align-items: center !important;
    }
    
    /* PDF 모드에서 폰트 크기 최적화 (가로 모드용) */
    .pdf-slide h1 {
        font-size: 2.8rem !important;
        line-height: 1.2 !important;
        margin: 1rem 0 !important;
        text-align: center !important;
        color: black !important;
        font-weight: bold !important;
        page-break-after: avoid !important;
    }
    
    .pdf-slide h2 {
        font-size: 2.4rem !important;
        line-height: 1.3 !important;
        margin: 0.8rem 0 !important;
        text-align: center !important;
        color: black !important;
        font-weight: bold !important;
        page-break-after: avoid !important;
    }
    
    .pdf-slide h3 {
        font-size: 2rem !important;
        line-height: 1.4 !important;
        margin: 0.6rem 0 !important;
        text-align: center !important;
        color: black !important;
        font-weight: bold !important;
        page-break-after: avoid !important;
    }
    
    .pdf-slide h4 {
        font-size: 2.5rem !important; /* 85% of 2.9rem */
        line-height: 1.4 !important;
        margin: 0.4rem 0 !important;
        text-align: center !important;
        color: black !important;
    }
    
    .pdf-slide h5 {
        font-size: 2.3rem !important; /* 85% of 2.7rem */
        line-height: 1.4 !important;
        margin: 0.4rem 0 !important;
        text-align: center !important;
        color: black !important;
    }
    
    .pdf-slide h6 {
        font-size: 2.1rem !important; /* 85% of 2.5rem */
        line-height: 1.4 !important;
        margin: 0.4rem 0 !important;
        text-align: center !important;
        color: black !important;
    }
    
    .pdf-slide p {
        font-size: 1.4rem !important;
        line-height: 1.6 !important;
        margin: 0.6rem 0 !important;
        text-align: center !important;
        color: black !important;
        page-break-inside: avoid !important;
    }
    
    .pdf-slide li {
        font-size: 1.3rem !important;
        line-height: 1.8 !important;
        margin: 0.3rem 0 !important;
        color: black !important;
        text-align: left !important;
        page-break-inside: avoid !important;
    }
    
    .pdf-slide ul,
    .pdf-slide ol {
        margin: 0.8rem 0 !important;
        padding-left: 2rem !important;
        max-width: 85% !important;
        text-align: left !important;
        page-break-inside: auto !important;
    }
    
    .pdf-slide ul {
        list-style-type: disc !important;
    }
    
    .pdf-slide ol {
        list-style-type: decimal !important;
    }
    
    .pdf-slide img {
        max-width: 80% !important;
        max-height: 60vh !important;
        margin: 0.8rem auto !important;
        display: block !important;
        page-break-inside: avoid !important;
        page-break-before: auto !important;
        page-break-after: auto !important;
    }
    
    .pdf-slide .text-center {
        text-align: center !important;
        margin: 0.8rem auto !important;
        font-size: 2.1rem !important; /* 85% of 2.5rem */
        line-height: 1.5 !important;
        color: black !important;
    }
    
    .pdf-slide .text-center p {
        font-size: 2.1rem !important; /* 85% of 2.5rem */
        line-height: 1.5 !important;
        margin: 0.4rem 0 !important;
        text-align: center !important;
        color: black !important;
    }
    
    .pdf-slide .text-large {
        font-size: 2.1rem !important; /* Adjusted */
        line-height: 1.4 !important;
        color: black !important;
    }
    
    .pdf-slide .text-xlarge {
        font-size: 2.9rem !important; /* Adjusted */
        line-height: 1.3 !important;
        color: black !important;
    }
    
    /* Code blocks with proper styling */
    .pdf-slide pre {
        background-color: #f6f8fa !important;
        border: 1px solid #d1d5da !important;
        border-radius: 6px !important;
        padding: 0.8rem !important;
        margin: 0.8rem 0 !important;
        max-width: 90% !important;
        overflow-x: auto !important;
        page-break-inside: auto !important;
    }
    
    .pdf-slide pre,
    .pdf-slide pre code {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        font-family: 'Courier New', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace !important;
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
    }
    
    /* Inline code with proper styling */
    .pdf-slide code:not(pre code) {
        background-color: #f3f4f6 !important;
        padding: 0.2rem 0.4rem !important;
        border-radius: 3px !important;
        font-size: 0.85em !important;
        line-height: inherit !important;
        font-family: 'Courier New', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace !important;
        color: #1f2937 !important;
    }
    
    /* Links in PDF */
    .pdf-slide a {
        color: #2563eb !important;
        text-decoration: none !important;
    }
    
    /* PDF에서 코드 하이라이팅 보존 */
    .pdf-slide code[class*="language-"],
    .pdf-slide pre[class*="language-"] {
        background: #f6f8fa !important;
        color: #24292e !important;
        font-family: 'Courier New', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace !important;
        text-align: left !important;
    }
    
    .pdf-slide .token.comment,
    .pdf-slide .token.prolog,
    .pdf-slide .token.doctype,
    .pdf-slide .token.cdata {
        color: #708090 !important;
    }
    
    .pdf-slide .token.punctuation {
        color: #999 !important;
    }
    
    .pdf-slide .namespace {
        opacity: .7 !important;
    }
    
    .pdf-slide .token.property,
    .pdf-slide .token.tag,
    .pdf-slide .token.boolean,
    .pdf-slide .token.number,
    .pdf-slide .token.constant,
    .pdf-slide .token.symbol,
    .pdf-slide .token.deleted {
        color: #905 !important;
    }
    
    .pdf-slide .token.selector,
    .pdf-slide .token.attr-name,
    .pdf-slide .token.string,
    .pdf-slide .token.char,
    .pdf-slide .token.builtin,
    .pdf-slide .token.inserted {
        color: #690 !important;
    }
    
    .pdf-slide .token.operator,
    .pdf-slide .token.entity,
    .pdf-slide .token.url,
    .pdf-slide .language-css .token.string,
    .pdf-slide .style .token.string {
        color: #a67f59 !important;
    }
    
    .pdf-slide .token.atrule,
    .pdf-slide .token.attr-value,
    .pdf-slide .token.keyword {
        color: #07a !important;
    }
    
    .pdf-slide .token.function {
        color: #DD4A68 !important;
    }
    
    .pdf-slide .token.regex,
    .pdf-slide .token.important,
    .pdf-slide .token.variable {
        color: #e90 !important;
    }
    
    .pdf-slide .token.important,
    .pdf-slide .token.bold {
        font-weight: bold !important;
    }
    
    .pdf-slide .token.italic {
        font-style: italic !important;
    }
    
    .pdf-slide .token.entity {
        cursor: help !important;
    }
    
    /* PDF 로고 스타일 */
    .pdf-logo {
        position: absolute !important;
        top: 1cm !important;
        left: 1cm !important;
        z-index: 1000 !important;
        max-width: 120px !important;
        max-height: 120px !important;
    }

    /* KaTeX math styling */
    .math-display {
        font-size: 1.1em !important;
        margin: 1rem 0 !important;
        text-align: center !important;
        overflow-x: auto !important;
    }

    .math-inline {
        font-size: 1em !important;
        margin: 0 !important;
        vertical-align: baseline !important;
    }

    .math-error {
        color: #d32f2f !important;
        background-color: #ffebee !important;
        padding: 0.2rem 0.4rem !important;
        border-radius: 0.25rem !important;
        font-family: monospace !important;
    }

    /* Mermaid diagram styles */
    .mermaid-container {
        display: block;
        margin: 2rem 0;
        padding: 1rem;
        width: 100%;
        overflow: visible; /* Changed to visible for PDF */
    }
    
    /* Ensure mermaid div inside container is properly styled */
    .mermaid-container .mermaid {
        margin: 0 auto !important;
        font-size: 1.2em !important; /* Increase text size in PDF */
    }

    .mermaid-container svg {
        max-width: 90% !important; /* Reduced to prevent overflow in PDF */
        height: auto !important;
        transform: scale(1) !important; /* Removed scaling to prevent overflow */
        transform-origin: center !important;
    }

    .mermaid-error {
        color: #d32f2f;
        background-color: #ffebee;
        padding: 1rem;
        border-radius: 0.5rem;
        border: 1px solid #ffcdd2;
        font-family: 'D2Coding', 'Courier New', monospace;
        text-align: center;
    }

    /* Tables in PDF */
    .pdf-slide table {
        border-collapse: collapse !important;
        margin: 0.8rem auto !important;
        max-width: 90% !important;
        page-break-inside: auto !important;
    }
    
    .pdf-slide th,
    .pdf-slide td {
        border: 1px solid #d1d5da !important;
        padding: 0.4rem 0.8rem !important;
        text-align: left !important;
        font-size: 1.2rem !important;
        page-break-inside: avoid !important;
    }
    
    .pdf-slide th {
        background-color: #f6f8fa !important;
        font-weight: bold !important;
    }
    
    /* Blockquotes in PDF */
    .pdf-slide blockquote {
        border-left: 4px solid #d1d5da !important;
        padding-left: 1rem !important;
        margin: 1rem 0 !important;
        color: #586069 !important;
        font-style: italic !important;
    }
    
    /* PDF specific math styling */
    .pdf-slide .math-display {
        font-size: 1.2em !important;
        margin: 1.5rem 0 !important;
        text-align: center !important;
        overflow-x: visible !important;
    }

    .pdf-slide .math-inline {
        font-size: 1em !important;
        margin: 0 !important;
        vertical-align: baseline !important;
    }

    .pdf-slide .math-error {
        color: #d32f2f !important;
        background-color: #ffebee !important;
        padding: 0.2rem 0.4rem !important;
        border-radius: 0.25rem !important;
        font-family: monospace !important;
    }
    
    .pdf-logo-image {
        max-width: 120px !important;
        max-height: 120px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        margin: 0 !important;
        box-shadow: none !important;
        border-radius: 4px !important;
    }
    
    /* 페이지 번호 제거 */
    .pdf-slide::after {
        display: none;
    }
    
    /* Horizontal rules in PDF */
    .pdf-slide hr {
        border: none !important;
        border-top: 2px solid #d1d5da !important;
        margin: 1.5rem 0 !important;
        width: 80% !important;
    }
    
    /* Text decoration classes */
    .pdf-slide .text-highlight {
        background-color: #fff3cd !important;
        padding: 0.2rem 0.4rem !important;
        border-radius: 3px !important;
        color: black !important;
    }
    
    .pdf-slide .text-bold {
        font-weight: bold !important;
    }
    
    .pdf-slide .text-small {
        font-size: 0.8em !important;
    }
    
    .pdf-slide .text-xlarge {
        font-size: 1.5em !important;
    }
    
    @page {
        size: A4 landscape;
        margin: 0;
    }
}

/* Keyboard navigation indicators */
.keyboard-navigation {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
}

/* Dark mode keyboard navigation */
.dark .keyboard-navigation {
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
}

.keyboard-navigation.show {
    opacity: 1;
}

/* Loading spinner - use Tailwind's animate-spin */
.animate-spin {
    @apply animate-spin;
}

/* Repository History Styles */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.dark .history-item {
    background-color: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}

.dark .history-item:hover {
    background-color: #334155;
    border-color: #64748b;
}

.history-item-info {
    flex-grow: 1;
    min-width: 0; /* Important for text truncation */
}

.history-item-url {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .history-item-url {
    color: #f1f5f9;
}

.history-item-folder {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .history-item-folder {
    color: #9ca3af;
}

.history-item-delete {
    padding: 0.25rem;
    color: #ef4444;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
    margin-left: 0.5rem;
}

.history-item-delete:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

.dark .history-item-delete:hover {
    background-color: #7f1d1d;
    color: #fca5a5;
}

/* Custom text formatting classes */
.text-center {
    @apply text-center my-6;
    font-size: inherit;
    line-height: 1.8;
}

#slide-content .text-center {
    @apply block text-center mx-auto my-6;
}

/* Center class list handling */
#slide-content .text-center ul,
#slide-content .text-center ol {
    @apply block text-center my-4 mx-auto w-fit pl-0;
    list-style-position: inside;
}

#slide-content .text-center ul {
    @apply list-disc;
}

#slide-content .text-center ol {
    @apply list-decimal;
}

#slide-content .text-center li {
    @apply text-center;
    list-style-position: inside;
}

.text-large {
    @apply font-medium my-6;
    font-size: 2.5rem; /* Same as base text now */
    line-height: 1.6;
}

.text-small {
    @apply font-normal my-4;
    font-size: 2rem; /* Smaller than base text */
    line-height: 1.6;
}

.text-xlarge {
    @apply font-semibold my-8;
    font-size: 3.5rem; /* Reduced from 4rem */
    line-height: 1.5;
}

.text-highlight {
    background: linear-gradient(120deg, #a7f3d0 0%, #a7f3d0 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.2em;
    background-position: 0 88%;
    padding: 0.25rem 0.5rem; /* 패딩 확대 */
    border-radius: 0.5rem; /* 보더 라디우스 확대 */
    font-size: inherit; /* 부모 요소의 폰트 크기 상속 */
    line-height: inherit; /* 부모 요소의 줄간격 상속 */
    display: inline; /* 인라인 요소로 설정하여 텍스트 길이에 맞춤 */
    box-decoration-break: clone; /* 줄바꿈 시 장식 유지 */
}

/* **텍스트** (strong 태그)에 형광펜 효과 적용 */
#slide-content strong {
    background: linear-gradient(120deg, #a7f3d0 0%, #a7f3d0 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.2em;
    background-position: 0 88%;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: inherit;
    line-height: inherit;
    display: inline;
    box-decoration-break: clone;
    font-weight: 700; /* 굵기 유지 */
}

.dark .text-highlight {
    background: linear-gradient(120deg, #065f46 0%, #065f46 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.2em;
    background-position: 0 88%;
    color: #a7f3d0;
}

/* 다크모드에서 strong 태그 스타일 */
.dark #slide-content strong {
    background: linear-gradient(120deg, #065f46 0%, #065f46 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.2em;
    background-position: 0 88%;
    color: #a7f3d0;
}

.text-bold {
    @apply font-bold text-gray-800 dark:text-gray-100;
    font-size: inherit;
    line-height: inherit;
}

/* Font family classes - keep as-is for custom fonts */
.font-family-default { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.font-family-bmjua { font-family: 'BMJUA', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.font-family-bmhanna { font-family: 'BMHANNA', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.font-family-bmdohyeon { font-family: 'BMDOHYEON', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.font-family-bmyeonsung { font-family: 'BMYEONSUNG', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.font-family-bmeuljirot { font-family: 'BMEULJIROT', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.font-family-maruburi { font-family: 'MaruBuri', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

/* Select dropdown styling */
#folder-dropdown {
    position: relative;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

#folder-dropdown option {
    padding: 8px 12px;
    background-color: #ffffff;
    color: #1f2937;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#folder-dropdown option:hover {
    background-color: #f3f4f6;
}

#folder-dropdown option:checked {
    background-color: #3b82f6;
    color: #ffffff;
}

/* Dark mode select dropdown */
.dark #folder-dropdown option {
    background-color: #374151;
    color: #f9fafb;
}

.dark #folder-dropdown option:hover {
    background-color: #4b5563;
}

.dark #folder-dropdown option:checked {
    background-color: #2563eb;
    color: #ffffff;
}

/* Ensure dropdown appears above other elements */
#folder-selection {
    position: relative;
    z-index: 10;
}

/* Improved select box spacing */
#folder-selection {
    margin-bottom: 1.5rem;
}

/* Bottom Navigation Container Styles */
#bottom-nav-container {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Control Button Tooltips */
.control-btn {
    position: relative;
}

.control-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 18px);
    left: 50%;
    transform: translateX(-50%);
    background: #121314;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.control-btn::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #121314;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.control-btn:hover::after,
.control-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Settings Dropdown Styles */
#settings-dropdown {
    animation: fadeIn 0.2s ease-out;
    z-index: 9999 !important;
}

#settings-dropdown.hidden {
    animation: fadeOut 0.2s ease-out;
}

/* Fix select dropdown cutoff */
#settings-dropdown select {
    position: relative;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Dark mode support for settings dropdown */
.dark #settings-dropdown svg rect[fill="white"] {
    fill: #1f2937 !important;
}

/* File List Popup Styles */
#file-list-popup {
    animation: slideUp 0.3s ease-out;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

#file-list-popup.hidden {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}


/* Ensure file navigation sidebar is positioned correctly */
#file-nav-sidebar {
    top: 80px !important;
    left: 20px !important;
    right: auto !important;
}

/* Dark mode switch animation */
.dark #switch-circle {
    transform: translateX(24px);
}

.dark #sun-icon {
    transform: translateX(24px);
}

.dark #moon-icon {
    transform: translateX(-24px);
}

/* Dark mode settings button */
.dark #settings-bg {
    fill: #1f2937;
}

.dark #settings-dot1,
.dark #settings-dot2,
.dark #settings-dot3 {
    fill: #d1d5db;
}

/* File list popup positioning */
#file-list-popup {
    position: absolute !important;
    bottom: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-bottom: 1rem !important;
}

/* Dark mode bottom navigation boxes */
.dark #bottom-nav-container .bg-white {
    background-color: #1f2937 !important;
}

.dark #bottom-nav-container .border-gray-200 {
    border-color: #4b5563 !important;
}

/* Dark mode navigation box text colors */
.dark #bottom-nav-container .text-gray-700 {
    color: #ffffff !important;
}

.dark #bottom-nav-container .text-gray-900 {
    color: #ffffff !important;
}

/* Footer Styles */
.footer-container {
    background-color: #F3F5FA;
    height: auto;
    min-height: 140px; /* Increased from 120px */
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #E5E7EB;
    margin-top: auto;
}

.footer-content {
    max-width: 1920px;
    width: 100%;
    padding: 0 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Footer text section */
.footer-text {
    flex: 1;
}

.footer-logo-section {
    display: flex;
    align-items: center;
    gap: 1px;
    margin-bottom: 18px;
    margin-top: 24px; /* Add top margin to separate from top edge */
}

.footer-logo svg {
    height: 20px; /* Same as header logo size on desktop */
    width: auto;
}

.footer-copyright {
    font-size: 13px;
    color: #8D9299;
}

.footer-text-content {
    font-size: 14px;
    line-height: 1.6;
    color: #47494D;
    margin: 0;
}

/* Footer icons section */
.footer-icons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.footer-icon-button {
    width: 40px;
    height: 40px;
    border-radius: 7.5px;
    background-color: #F3F5FA;
    border: 1px solid #D9DBE0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 6px;
    color: #8D9299;
}

.footer-icon-button:hover {
    background-color: #E5E7EB;
    border-color: #9CA3AF;
}

.footer-icon-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Dark mode footer styles */
.dark .footer-container {
    background-color: #1F2937;
    border-top-color: #374151;
}

.dark .footer-text-content {
    color: #D1D5DB;
}

.dark .footer-logo svg path {
    fill: #9CA3AF;
}

.dark .footer-copyright {
    color: #9CA3AF;
}

.dark .footer-icon-button {
    background-color: #374151;
    border-color: #4B5563;
    color: #9CA3AF;
}

.dark .footer-icon-button:hover {
    background-color: #4B5563;
    border-color: #6B7280;
    color: #D1D5DB;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-container {
        height: auto;
        min-height: auto;
        padding: 24px 0;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        padding: 0 20px;
        text-align: center;
        align-items: center;
    }
    
    .footer-text {
        width: 100%;
        text-align: center;
    }
    
    /* Change logo section to column layout on mobile */
    .footer-logo-section {
        flex-direction: column; /* Change from row to column */
        align-items: center; /* Center align items */
        justify-content: center;
        gap: 12px; /* Add gap between logo and copyright */
        margin-bottom: 16px;
    }
    
    .footer-logo {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .footer-logo svg {
        height: 14px; /* Keep consistent with desktop */
    }
    
    .footer-copyright {
        font-size: 12px;
        text-align: center;
        width: 100%;
    }
    
    .footer-text-content {
        font-size: 11px;
        line-height: 1.4;
        text-align: center;
    }
    
    .footer-icons {
        justify-content: center;
        gap: 8px;
    }
    
    .footer-icon-button {
        width: 32px;
        height: 32px;
    }
    
    .footer-icon-button svg {
        width: 16px;
        height: 16px;
    }
}

/* Print styles - hide footer */
@media print {
    .footer-container {
        display: none !important;
    }
}

/* Hide mobile info text on desktop */
.mobile-only-info {
    display: none;
}

/* Preview styles */
#preview-container {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
}

#preview-content .slide-content {
    background: white;
    color: black;
    border-radius: 6px;
    margin: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: calc(100% - 16px);
}

/* Dark theme preview */
.dark #preview-content .slide-content {
    background: #1f2937;
    color: white;
}

/* Preview slide content styling - match actual slide styles */
#preview-content .slide-content h1,
#preview-content .slide-content h2,
#preview-content .slide-content h3 {
    margin-bottom: 1rem;
}

#preview-content .slide-content h1 {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 4px;
}

#preview-content .slide-content h2 {
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.35;
    color: #1f2937;
}

#preview-content .slide-content h3 {
    font-size: 0.55rem;
    font-weight: 600;
    line-height: 1.4;
    color: #374151;
}

#preview-content .slide-content p {
    font-size: 0.5rem;
    line-height: 1.8;
    margin-bottom: 6px;
}

#preview-content .slide-content ul,
#preview-content .slide-content ol {
    text-align: left;
    max-width: 90%;
    margin: 4px auto;
    padding-left: 16px;
}

#preview-content .slide-content li {
    margin-bottom: 2px;
    font-size: 0.5rem;
    line-height: 1.8;
}

#preview-content .slide-content code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

#preview-content .slide-content pre {
    background: rgba(0, 0, 0, 0.1);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    text-align: left;
    margin: 1rem 0;
}

/* Dark theme code styling */
.dark #preview-content .slide-content code {
    background: rgba(255, 255, 255, 0.1);
}

.dark #preview-content .slide-content pre {
    background: rgba(255, 255, 255, 0.1);
}

/* Slide Thumbnails Styles */
.slide-thumbnail {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.slide-thumbnail:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.slide-thumbnail.active {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.slide-thumbnail-inner {
    background: white;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.slide-thumbnail-content {
    font-size: 0.5rem;
    line-height: 1.8;
    color: #374151;
    width: 100%;
    height: 100%;
    display: block;
    padding: 8px;
    overflow: hidden;
    text-align: left;
}

.slide-thumbnail-content h1 {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px 0;
    color: #1f2937;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 4px;
}

.slide-thumbnail-content h2 {
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 8px 0 6px 0;
    color: #1f2937;
}

.slide-thumbnail-content h3 {
    font-size: 0.55rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 6px 0 4px 0;
    color: #374151;
}

.slide-thumbnail-content p {
    font-size: 0.5rem;
    margin: 0 0 6px 0;
    line-height: 1.8;
}

.slide-thumbnail-content img {
    max-width: 60%;
    max-height: 40px;
    object-fit: contain;
    margin: 4px auto;
    border-radius: 4px;
    display: block;
}

.slide-thumbnail-content ul, .slide-thumbnail-content ol {
    font-size: 0.5rem;
    margin: 4px 0;
    padding-left: 16px;
    text-align: left;
}

.slide-thumbnail-content li {
    margin: 2px 0;
    line-height: 1.8;
}

.slide-thumbnail-number {
    position: absolute;
    top: 4px;
    left: 6px;
    background: #3b82f6;
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 500;
}

/* Dark theme for thumbnails */
.dark .slide-thumbnail {
    background: #374151;
    border-color: #4b5563;
}

.dark .slide-thumbnail:hover {
    border-color: #60a5fa;
}

.dark .slide-thumbnail.active {
    border-color: #60a5fa;
    box-shadow: 0 2px 4px rgba(96, 165, 250, 0.1);
}

.dark .slide-thumbnail-inner {
    background: #374151;
}

.dark .slide-thumbnail-content {
    color: #d1d5db;
}

.dark .slide-thumbnail-content h1 {
    color: #f9fafb;
}

.dark .slide-thumbnail-content h2 {
    color: #e5e7eb;
}

.dark .slide-thumbnail-content h3 {
    color: #d1d5db;
}

.dark .slide-thumbnail-number {
    background: #60a5fa;
}

/* Custom styles for thumbnails */
.slide-thumbnail-content .text-center {
    text-align: center;
    margin: 4px 0;
}

.slide-thumbnail-content .text-xlarge {
    font-size: 0.65rem;
}

.slide-thumbnail-content .text-small {
    font-size: 0.4rem;
}

.slide-thumbnail-content .text-highlight {
    background: linear-gradient(120deg, #a7f3d0 0%, #a7f3d0 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.2em;
    background-position: 0 88%;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Strong tag in thumbnails */
.slide-thumbnail-content strong {
    background: linear-gradient(120deg, #a7f3d0 0%, #a7f3d0 100%);
    background-repeat: no-repeat;
    background-size: 100% 0.2em;
    background-position: 0 88%;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 700;
}

.slide-thumbnail-content code {
    background-color: #f1f5f9;
    color: #dc2626;
    padding: 1px 2px;
    border-radius: 2px;
    font-size: 0.45rem;
}

.dark .slide-thumbnail-content code {
    background-color: #4b5563;
    color: #fca5a5;
}

.slide-thumbnail-content pre {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 4px;
    overflow-x: visible;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 4px 0;
    font-size: 0.45rem;
}

.dark .slide-thumbnail-content pre {
    background-color: #4b5563;
    border-color: #6b7280;
}

.slide-thumbnail-content blockquote {
    border-left: 2px solid #3b82f6;
    background-color: #eff6ff;
    padding: 4px;
    margin: 4px 0;
    border-radius: 0 4px 4px 0;
    font-size: 0.5rem;
}

.dark .slide-thumbnail-content blockquote {
    border-left-color: #60a5fa;
    background-color: #374151;
    color: #e5e7eb;
}

/* Links in thumbnails */
.slide-thumbnail-content a {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.5rem;
}

.dark .slide-thumbnail-content a {
    color: #60a5fa;
}