* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    color: #fff;
    overflow: hidden;
    height: 100vh;
    position: fixed;
    width: 100%;
    -webkit-touch-callout: none; /* iOS Safari 텍스트 선택 방지 */
}

.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: radial-gradient(ellipse at center, #1e3c72 0%, #0f0c29 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 1s ease-out;
}

.intro-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.intro-content {
    text-align: center;
    position: relative;
}

.intro-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF6347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: introTitleGlow 3s ease-in-out infinite;
    letter-spacing: 2px;
}

@keyframes introTitleGlow {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.3));
    }
    50% { 
        transform: scale(1.05);
        filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.6));
    }
}

.intro-subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    margin-bottom: 10px;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.5s forwards;
    color: rgba(255, 255, 255, 0.9);
}

.intro-date {
    font-size: clamp(1rem, 2vw, 1.5rem);
    opacity: 0;
    animation: fadeInUp 1s ease-out 1s forwards;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
}

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

.intro-progress {
    width: 300px;
    height: 6px;
    background: rgba(128, 128, 128, 0.3);  /* 더 명확한 회색 배경 */
    margin: 0 auto 30px;
    border-radius: 3px;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 1s ease-out 1.5s forwards;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);  /* 깊이감 추가 */
}

.intro-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    width: 0%;
    animation: introProgressFill 3s ease-out 2s forwards;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);  /* 채워진 부분 강조 */
    position: relative;
    overflow: hidden;
}

/* 인트로 진행 표시줄에도 빛나는 효과 추가 */
.intro-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes introProgressFill {
    to { width: 100%; }
}

.intro-skip {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeIn 1s ease-out 2.5s forwards;
}

.intro-skip:hover {
    border-color: rgba(255, 255, 255, 0.8);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.main-title {
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 700;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #ffe66d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 5s ease infinite;
    margin-bottom: 10px;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.ministry-title {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 1px;
    min-height: 2rem;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.ministry-title.active {
    opacity: 1;
    transform: translateY(0);
}

.progress-bar {
    width: 100%;
    max-width: 600px;
    height: 8px;
    background: rgba(128, 128, 128, 0.3);  /* 더 명확한 회색 배경 */
    border-radius: 4px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);  /* 깊이감 추가 */
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);  /* 부드러운 애니메이션 */
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);  /* 채워진 부분 강조 */
    position: relative;
    overflow: hidden;
}

/* 진행 표시줄에 빛나는 효과 추가 */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.slideshow-container {
    flex: 1;
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slides-wrapper {
    position: relative;
    width: 100%;
    height: 70vh;
    max-height: 800px;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    touch-action: pan-y pinch-zoom;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(100%) scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    z-index: 5; /* nav-btn보다 낮게 설정 */
}

.slide.prev {
    opacity: 0;
    transform: translateX(-100%) scale(0.8);
    z-index: 1;
}

.slide.next {
    opacity: 0;
    transform: translateX(100%) scale(0.8);
    z-index: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.slide-content {
    display: none;
}

/* Ministry Display - Inside slides wrapper */
.ministry-display {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100; /* 더 높은 z-index */
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari 지원 */
    padding: 12px 30px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    white-space: nowrap; /* 텍스트 한 줄 유지 */
}

.ministry-display.active {
    opacity: 1;
}

.ministry-display-text {
    font-size: clamp(1.1rem, 2.5vw, 1.8rem);
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    letter-spacing: 0.5px;
    margin: 0;
    display: block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 90; /* ministry-display보다 약간 낮게 */
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.nav-btn svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}




@media (max-width: 768px) {
    .intro-progress {
        width: 200px;
    }
    
    .intro-title {
        font-size: 2rem;
    }
    
    .intro-subtitle {
        font-size: 1.2rem;
    }
    
    .intro-date {
        font-size: 1rem;
    }
    
    header {
        padding: 15px 10px;
    }
    
    .main-title {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .ministry-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
        min-height: 1.5rem;
    }
    
    .slideshow-container {
        padding: 10px 5px;
        flex: 1;
    }

    .slides-wrapper {
        height: calc(100vh - 180px);
        max-height: 60vh;
        border-radius: 15px;
    }

    .nav-btn {
        width: 45px;
        height: 45px;
    }

    .nav-btn svg {
        width: 20px;
        height: 20px;
    }

    .prev {
        left: 10px;
    }

    .next {
        right: 10px;
    }

    .slide-content {
        display: none;
    }
    
    .ministry-display {
        top: 10px;
        padding: 6px 16px;
        border-radius: 20px;
    }
    
    .ministry-display-text {
        font-size: 0.9rem;
        letter-spacing: 0.3px;
    }

}

@media (min-width: 1400px) {
    .slides-wrapper {
        height: 80vh;
        max-height: 900px;
    }
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #4ecdc4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fullscreen .slideshow-container {
    max-width: 100%;
    padding: 0;
}

.fullscreen .slides-wrapper {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
}

.fullscreen header {
    display: none;
}

.fullscreen .ministry-display {
    top: 30px;
    padding: 12px 28px;
    font-size: 1.1rem;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Floating Button Styles */
.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 30px rgba(78, 205, 196, 0.3);
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    border: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.floating-btn.dragging {
    cursor: grabbing;
    transition: none;
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 40px rgba(78, 205, 196, 0.6);
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4), 0 0 40px rgba(78, 205, 196, 0.5);
}

.floating-btn:active {
    transform: scale(0.95);
}

.floating-btn svg {
    width: 30px;
    height: 30px;
    fill: #fff;
    pointer-events: none; /* 드래그 시 아이콘이 방해하지 않도록 */
}

/* Ministry Menu Styles */
.ministry-menu {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    width: 320px;
    transform: scale(0);
    transform-origin: bottom right;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 999;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ministry-menu.active {
    transform: scale(1);
    opacity: 1;
}

.ministry-menu h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #fff;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.ministry-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ministry-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ministry-item:hover {
    background: rgba(78, 205, 196, 0.2);
    border-color: rgba(78, 205, 196, 0.5);
    color: #fff;
    transform: translateX(-5px);
}

.ministry-item:active {
    transform: scale(0.98);
}

.ministry-item .count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 10px;
}

/* Custom Scrollbar for Ministry Menu */
.ministry-menu::-webkit-scrollbar {
    width: 6px;
}

.ministry-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.ministry-menu::-webkit-scrollbar-thumb {
    background: rgba(78, 205, 196, 0.5);
    border-radius: 3px;
}

.ministry-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 205, 196, 0.8);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .floating-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .floating-btn.dragging {
        width: 55px;
        height: 55px;
    }
    
    .floating-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .ministry-menu {
        bottom: 80px;
        right: 20px;
        left: auto;
        width: calc(100vw - 40px);
        max-width: 320px;
        max-height: 50vh;
    }
    
    .ministry-item {
        font-size: 0.9rem;
        padding: 10px 14px;
    }
}