/* 서대전여자고등학교 홍보 페이지 - 커스텀 스타일 */

/* 풍경 갤러리 모달 스타일 */
.scenery-container {
    padding: 0;
}

.scenery-panel {
    margin-bottom: 2px;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.scenery-panel:first-child {
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

.scenery-panel:last-child {
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    margin-bottom: 0;
}

.scenery-panel img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.scenery-caption {
    transition: opacity 0.3s ease;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .scenery-container {
        padding: 0;
    }
    
    .scenery-panel {
        margin-bottom: 1px;
    }
    
    .scenery-caption {
        opacity: 1 !important;
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    }
    
    .scenery-caption p {
        font-size: 0.875rem;
        line-height: 1.3;
    }
    
    .scenery-caption p:first-child {
        font-size: 1rem;
        font-weight: bold;
    }
}

/* 커스텀 스크롤바 */
.scrollbar-thin {
    scrollbar-width: thin;
}

.scrollbar-thumb-purple-300::-webkit-scrollbar {
    width: 6px;
}

.scrollbar-thumb-purple-300::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.scrollbar-thumb-purple-300::-webkit-scrollbar-thumb {
    background: #d8b4fe;
    border-radius: 3px;
}

.scrollbar-thumb-purple-300::-webkit-scrollbar-thumb:hover {
    background: #c084fc;
}

/* 웹툰 스타일 스크롤 애니메이션 */
.scenery-panel {
    animation: slideInUp 0.6s ease-out;
}

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

/* 기본 폰트 설정 */
body {
    font-family: 'Noto Sans KR', sans-serif;
    overflow-x: hidden;
}

/* Hero Section 배경 - 개선된 그라데이션 */
.hero-bg {
    background: linear-gradient(135deg, 
        #667eea 0%, 
        #764ba2 25%, 
        #f093fb 50%, 
        #f5576c 75%, 
        #feca57 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow: hidden;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(100px);
}

.hero-bg > div {
    position: relative;
    z-index: 1;
}

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

/* 차트 컨테이너 */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    height: 450px;
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .chart-container {
        height: 400px;
        padding: 15px;
    }
}

/* 통계 카드 스타일 */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transition: all 0.5s ease;
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.4);
}

.stat-card:hover::before {
    top: -30%;
    right: -30%;
}

/* 네비게이션 아이템 */
.nav-item {
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 4px;
}

.nav-item:hover {
    transform: translateY(-2px);
    color: #667eea;
}

.nav-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -8px;
    left: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-item:hover::after {
    width: 100%;
}

.active-nav {
    color: #667eea;
    font-weight: 700;
}

.active-nav::after {
    width: 100%;
}

/* 부드러운 스크롤 */
html {
    scroll-behavior: smooth;
}

/* 페이드인 애니메이션 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 동아리 카드 그리드 */
.clubs-grid {
    display: grid;
    gap: 1rem;
    padding: 0.5rem;
}

/* 모바일에서 2열, 태블릿에서 2열, 데스크톱에서 3-4열 */
@media (max-width: 640px) {
    .clubs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .clubs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 1025px) and (max-width: 1280px) {
    .clubs-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1281px) {
    .clubs-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

.club-card {
    position: relative;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.club-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 동아리 탭 스타일 */
.club-tab {
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.club-tab:hover {
    transform: translateY(-2px);
}

.club-tab.active {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 카드 애니메이션 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fadeInUp {
    animation: fadeInUp 0.5s ease-out;
}

/* 모바일에서 탭 스크롤 */
@media (max-width: 640px) {
    .club-tab {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
    
    .clubs-grid {
        padding: 0.25rem;
    }
    
    .club-card {
        min-height: 180px;
        padding: 1rem;
    }
    
    .club-card h4 {
        font-size: 1rem;
    }
    
    .club-card p {
        font-size: 0.75rem;
    }
}

/* 모바일 최적화 추가 스타일 */
@media (max-width: 480px) {
    .club-tab {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }
    
    .club-card {
        min-height: 160px;
        padding: 0.75rem;
    }
    
    .club-card h4 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .club-card p {
        font-size: 0.7rem;
        line-height: 1.4;
    }
    
    .club-card .text-3xl {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
}

/* 태블릿 최적화 */
@media (min-width: 641px) and (max-width: 1024px) {
    .club-card {
        min-height: 190px;
    }
}

/* 데스크톱 최적화 */
@media (min-width: 1025px) {
    .club-card {
        min-height: 220px;
    }
    
    .club-card:hover {
        transform: translateY(-8px);
    }
}

/* FAQ 아코디언 */
.faq-item {
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.faq-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.faq-question {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.faq-question:hover {
    background: linear-gradient(to right, rgba(239, 68, 68, 0.05), transparent);
}

.faq-question span:first-child {
    position: relative;
    padding-left: 8px;
}

.faq-question span:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: height 0.3s ease;
    border-radius: 2px;
}

.faq-question:hover span:first-child::before {
    height: 80%;
}

.faq-arrow {
    transition: transform 0.3s ease, color 0.3s ease;
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

.faq-arrow.rotate-45 {
    transform: rotate(45deg);
    color: #667eea;
}

/* 필터 버튼 */
.filter-btn {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.filter-btn:hover::before {
    width: 300px;
    height: 300px;
}

.filter-btn:hover {
    transform: translateY(-3px);
    border-color: #667eea;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.filter-btn.bg-red-500 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

.filter-btn.bg-red-500:hover {
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* 로고 이미지 */
header img {
    object-fit: contain;
}

/* 반응형 이미지 */
img {
    max-width: 100%;
    height: auto;
}

/* 버튼 호버 효과 개선 */
button {
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* 카드 호버 효과 */
.hover\:shadow-xl:hover {
    transform: translateY(-4px);
}

/* 스크롤 시 네비게이션 바 그림자 강화 */
header.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 모바일 메뉴 애니메이션 */
#mobile-menu {
    transition: all 0.3s ease;
}

#mobile-menu a {
    transition: all 0.2s ease;
}

/* 텍스트 선택 색상 */
::selection {
    background-color: rgba(239, 68, 68, 0.3);
    color: #1F2937;
}

::-moz-selection {
    background-color: rgba(239, 68, 68, 0.3);
    color: #1F2937;
}

/* 로딩 애니메이션 (선택사항) */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 반응형 텍스트 */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
        line-height: 2.5rem;
    }
    
    h2 {
        font-size: 1.75rem;
        line-height: 2.25rem;
    }
}

/* 접근성 개선 - 포커스 표시 */
*:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid #667eea;
    outline-offset: 4px;
}

/* 섹션 디바이더 - 파도 효과 */
.wave-divider {
    position: relative;
    height: 100px;
    overflow: hidden;
}

.wave-divider svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 유리모피즘 카드 */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 그라데이션 텍스트 */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 플로팅 애니메이션 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* 버튼 그라데이션 효과 */
.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #764ba2 0%, #f093fb 100%);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn-gradient:hover::before {
    left: 0;
}

/* 커리큘럼 카드 개선 */
.curriculum-card {
    position: relative;
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.curriculum-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.curriculum-card:hover::before {
    transform: scaleX(1);
}

.curriculum-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.2);
}

.curriculum-card .text-4xl {
    display: inline-block;
    transition: transform 0.3s ease;
}

.curriculum-card:hover .text-4xl {
    transform: scale(1.2) rotate(5deg);
}

/* 급식 이미지 그리드 개선 */
.food-grid {
    display: grid;
    gap: 1.5rem;
}

/* 급식 아이템 스타일 */
.food-item {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.food-item:hover {
    transform: translateY(-5px);
}

.food-item .relative {
    aspect-ratio: 16 / 9; /* 16:9 가로 비율 유지 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 0.5rem;
}

.food-item img {
    transition: all 0.3s ease;
    filter: brightness(0.98);
    width: 100%;
    height: 100%;
    object-fit: contain; /* 비율 유지하며 전체 이미지 표시 */
    object-position: center;
    image-rendering: auto;
    max-width: 100%;
    max-height: 100%;
}

.food-item:hover img {
    transform: scale(1.05);
    filter: brightness(1.02);
}

/* 급식 이미지 fallback 스타일 */
.food-item .relative > div[style*="display: none"] {
    background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.4));
    border: 2px dashed rgba(0,0,0,0.1);
    color: rgba(0,0,0,0.6);
    font-size: 3rem;
    animation: pulse 2s infinite;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 모바일에서 급식 이미지 최적화 */
@media (max-width: 768px) {
    .food-grid {
        gap: 1rem;
    }
    
    .food-item .relative {
        padding: 0.25rem;
    }
}

@media (max-width: 480px) {
    .food-grid {
        gap: 0.75rem;
    }
    
    .food-item .relative {
        padding: 0.125rem;
    }
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 급식 특징 카드 개선 */
.meal-feature {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 1.5rem;
    border-radius: 1.5rem;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.meal-feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.meal-feature:hover::before {
    transform: scaleX(1);
}

.meal-feature:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.15);
}

.meal-feature .text-5xl {
    transition: all 0.3s ease;
    display: inline-block;
}

.meal-feature:hover .text-5xl {
    transform: scale(1.15) rotate(5deg);
}

.meal-feature h4 {
    transition: all 0.3s ease;
}

.meal-feature:hover h4 {
    transform: translateY(-2px);
}

/* 모바일에서 급식 특징 최적화 */
@media (max-width: 768px) {
    .meal-feature {
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .meal-feature .text-5xl {
        font-size: 3rem;
        margin-bottom: 0.75rem;
    }
    
    .meal-feature h4 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .meal-feature p {
        font-size: 0.75rem;
        line-height: 1.4;
    }
}

/* 작은 모바일에서 추가 최적화 */
@media (max-width: 480px) {
    .meal-feature {
        padding: 0.75rem;
    }
    
    .meal-feature .text-5xl {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }
    
    .meal-feature h4 {
        font-size: 0.9rem;
    }
    
    .meal-feature p {
        font-size: 0.7rem;
    }
}

/* Hero 텍스트 효과 */
.hero-text {
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    color: white;
}

/* 통계 숫자 강조 */
.stat-number {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

/* 반짝이는 효과 */
@keyframes shine {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.shine {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    background-size: 200% 100%;
    animation: shine 3s infinite;
}

/* 장소 소개 섹션 스타일 */
.place-item {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.place-item:hover {
    transform: translateY(-5px);
}

.place-item img {
    transition: all 0.3s ease;
    filter: brightness(0.95);
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.place-item:hover img {
    transform: scale(1.05);
    filter: brightness(1.05);
}

/* 장소 이미지 fallback 스타일 */
.place-item .relative {
    min-height: 12rem; /* h-48과 동일 */
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .place-item .relative {
        min-height: 14rem; /* h-56과 동일 */
    }
}

.place-item .relative > div[style*="display: none"] {
    background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.4));
    border: 2px dashed rgba(0,0,0,0.1);
    color: rgba(0,0,0,0.6);
    font-size: 3rem;
    animation: pulse 2s infinite;
}

/* 장소 이미지 로딩 상태 */
.place-item img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

/* 장소 호버 오버레이 효과 */
.place-item .group:hover .absolute.inset-0 {
    backdrop-filter: blur(2px);
}

/* 모바일에서 장소 그리드 최적화 */
@media (max-width: 640px) {
    .place-item {
        margin-bottom: 1rem;
    }
    
    .place-item h4 {
        font-size: 1rem;
    }
    
    .place-item p {
        font-size: 0.75rem;
    }
}

/* AI·SW 방과후학교 이미지 스타일 */
.ai-sw-item img {
    transition: all 0.3s ease;
    filter: brightness(0.98);
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
}

.ai-sw-item:hover img {
    transform: scale(1.05);
    filter: brightness(1.02);
}

/* AI·SW 로봇 작품 이미지 컨테이너 */
.ai-sw-robots-container {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.5rem;
    border-radius: 1.5rem;
}

.ai-sw-robots-container img {
    object-fit: contain;
    object-position: center;
    width: 100%;
    height: 100%;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
}

/* 웹툰 스타일 */
.webtoon-container {
    border: 3px solid #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.webtoon-panel {
    border-bottom: 2px solid #333;
    position: relative;
    overflow: hidden;
}

.webtoon-panel:last-child {
    border-bottom: none;
}

.webtoon-panel img {
    transition: transform 0.3s ease;
}

.webtoon-panel:hover img {
    transform: scale(1.02);
}

.webtoon-caption {
    transition: opacity 0.3s ease;
}

.webtoon-panel:hover .webtoon-caption {
    opacity: 0.9;
}

/* 웹툰 말풍선 효과 */
.webtoon-caption p {
    position: relative;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.webtoon-caption p::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 10px solid rgba(255, 255, 255, 0.2);
}

/* 웹툰 애니메이션 */
@keyframes webtoonFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.webtoon-container:hover {
    animation: webtoonFloat 2s ease-in-out infinite;
}

/* 웹툰 썸네일 스타일 */
.webtoon-thumbnail-container {
    border: 2px solid #333;
    transition: all 0.3s ease;
}

.webtoon-thumbnail-container:hover {
    border-color: #6366f1;
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
}

/* 웹툰 모달 스타일 */
#webtoonModal {
    backdrop-filter: blur(8px);
}

#webtoonModal .webtoon-container {
    border: none;
    box-shadow: none;
}

#webtoonModal .webtoon-panel {
    border-bottom: 1px solid #e5e7eb;
}

#webtoonModal .webtoon-panel:last-child {
    border-bottom: none;
}

/* BGM 컨트롤 스타일 */
#bgm-toggle {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(147, 51, 234, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 모달이 열렸을 때 BGM 버튼과 가이드, 헤더 완전히 숨기기 */
#bgm-toggle.modal-open,
#mobile-bgm-guide.modal-open,
header.modal-open {
    display: none !important;
}

#bgm-toggle:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 35px rgba(147, 51, 234, 0.4);
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
}

#bgm-toggle:active {
    transform: scale(0.95) translateY(0);
}

#bgm-toggle svg {
    transition: all 0.3s ease;
}

#bgm-toggle:hover svg {
    transform: scale(1.1);
}

/* BGM 재생 중 펄스 애니메이션 */
#bgm-toggle.animate-pulse {
    animation: bgmPulse 2s ease-in-out infinite;
}

@keyframes bgmPulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(147, 51, 234, 0.3);
    }
    50% {
        box-shadow: 0 8px 25px rgba(147, 51, 234, 0.6), 0 0 20px rgba(147, 51, 234, 0.4);
    }
}

/* 볼륨 컨트롤 스타일 */
#volume-control {
    transition: all 0.3s ease;
    animation: slideInRight 0.3s ease-out;
}

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

/* 볼륨 슬라이더 커스텀 스타일 */
#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #8b5cf6 0%, #8b5cf6 30%, #e5e7eb 30%, #e5e7eb 100%);
    outline: none;
    border-radius: 15px;
    height: 6px;
    transition: all 0.3s ease;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.6);
}

#volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
}

#volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.6);
}

/* BGM 알림 스타일 */
.bgm-notification {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* 모바일에서 BGM 컨트롤 최적화 */
@media (max-width: 768px) {
    #bgm-toggle {
        top: 88px !important; /* 헤더 아래로 이동 */
        right: 16px !important;
        padding: 12px !important;
        box-shadow: 0 8px 25px rgba(147, 51, 234, 0.4) !important;
        z-index: 60 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 48px;
        height: 48px;
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    #bgm-toggle svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    #volume-control {
        top: 148px; /* BGM 버튼 아래로 이동 */
        right: 16px;
        padding: 12px;
    }
    
    #volume-slider {
        width: 80px;
    }
}

@media (max-width: 480px) {
    #bgm-toggle {
        top: 84px !important; /* 작은 화면에서도 헤더 아래로 이동 */
        right: 12px !important;
        padding: 10px !important;
        width: 44px !important;
        height: 44px !important;
        z-index: 60 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        border: 2px solid rgba(255, 255, 255, 0.4);
        box-shadow: 0 6px 20px rgba(147, 51, 234, 0.5) !important;
    }
    
    #bgm-toggle svg {
        width: 18px !important;
        height: 18px !important;
    }
    
    #volume-control {
        top: 140px; /* BGM 버튼 아래로 이동 */
        right: 12px;
        padding: 10px;
    }
    
    #volume-slider {
        width: 70px;
        height: 5px;
    }
    
    #volume-slider::-webkit-slider-thumb {
        width: 16px;
        height: 16px;
    }
    
    #volume-slider::-moz-range-thumb {
        width: 16px;
        height: 16px;
    }
}

/* BGM 버튼 접근성 개선 */
#bgm-toggle:focus {
    outline: 3px solid rgba(139, 92, 246, 0.5);
    outline-offset: 3px;
}

#volume-slider:focus {
    outline: 2px solid rgba(139, 92, 246, 0.5);
    outline-offset: 2px;
}

/* 다크모드 대응 (선택사항) */
@media (prefers-color-scheme: dark) {
    #volume-control {
        background: rgba(31, 41, 55, 0.9);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    #volume-slider {
        background: linear-gradient(to right, #8b5cf6 0%, #8b5cf6 30%, #4b5563 30%, #4b5563 100%);
    }
}

/* 모바일 BGM 안내 메시지 스타일 */
#mobile-bgm-guide {
    animation: slideInFromTop 0.5s ease-out;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* 모바일 BGM 안내 메시지 호버 효과 */
#mobile-bgm-guide:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.95) 0%, rgba(236, 72, 153, 0.95) 100%);
}

/* 모바일에서 BGM 안내 메시지 위치 조정 */
@media (max-width: 768px) {
    #mobile-bgm-guide {
        top: 88px !important; /* BGM 버튼과 같은 높이 */
        left: 8px !important;
        right: 72px !important; /* BGM 버튼 공간 확보 */
        padding: 10px !important;
        z-index: 45 !important;
        display: block !important;
    }
    
    #mobile-bgm-guide p {
        font-size: 0.8rem !important;
        line-height: 1.3;
    }
    
    #mobile-bgm-guide .text-xs {
        font-size: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    #mobile-bgm-guide {
        top: 84px !important; /* BGM 버튼과 같은 높이 */
        left: 8px !important;
        right: 64px !important; /* 작은 화면에서 BGM 버튼 공간 확보 */
        padding: 8px !important;
    }
    
    #mobile-bgm-guide p {
        font-size: 0.75rem !important;
        line-height: 1.2;
    }
    
    #mobile-bgm-guide .text-xs {
        font-size: 0.7rem !important;
    }
    
    #mobile-bgm-guide svg {
        width: 16px !important;
        height: 16px !important;
    }
}

/* BGM 버튼 펄스 효과 강화 */
@keyframes bgmButtonPulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(147, 51, 234, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 25px rgba(147, 51, 234, 0.6), 0 0 20px rgba(147, 51, 234, 0.4);
        transform: scale(1.05);
    }
}

#bgm-toggle.animate-pulse {
    animation: bgmButtonPulse 2s ease-in-out infinite;
}

/* 접근성 개선 - 고대비 모드 */
@media (prefers-contrast: high) {
    #bgm-toggle {
        border: 2px solid #ffffff;
        background: #000000 !important;
    }
    
    #volume-control {
        border: 2px solid #000000;
        background: #ffffff !important;
    }
    
    #mobile-bgm-guide {
        border: 2px solid #ffffff;
        background: #000000 !important;
    }
}

/* 애니메이션 줄이기 설정 대응 */
@media (prefers-reduced-motion: reduce) {
    #bgm-toggle,
    #volume-control,
    #mobile-bgm-guide {
        animation: none !important;
        transition: none !important;
    }
    
    #bgm-toggle:hover {
        transform: none !important;
    }
}


