/* 전역 리셋 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* PC에서 모바일 뷰 강조를 위한 배경 */

html {
    background: #e0e0e0;
}


/* 기본 스타일 */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background: #f5f5f5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    max-width: 540px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}


/* 상단 헤더 */

.app-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 540px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    padding: 0;
    height: 120px;
    display: flex;
    align-items: center;
}


/* 모바일에서 헤더 높이 조정 */

@media (max-width: 480px) {
    .app-header {
        height: 110px;
    }
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
}

.logo-section {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-logo {
    height: 10rem;
    width: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}


/* 모바일에서 로고 크기 조정 */

@media (max-width: 480px) {
    .header-logo {
        height: 8rem;
    }
}


/* 햄버거 버튼 */

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.hamburger-btn:hover {
    transform: scale(1.1);
}

.hamburger-line {
    width: 28px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}


/* 사이드 메뉴 */

.side-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    transition: right 0.3s ease;
    overflow-y: auto;
}


/* 540px 이하에서 사이드 메뉴 위치 조정 */

@media (max-width: 540px) {
    .side-menu {
        right: -280px;
    }
    .side-menu.active {
        right: 0;
    }
}

.side-menu.active {
    right: 0;
}

.side-menu-header {
    padding: 24px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-menu-header h2 {
    font-size: 1.5rem;
    color: #333;
}

.close-menu-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.close-menu-btn:hover {
    color: #333;
}

.menu-list {
    list-style: none;
    padding: 20px 0;
}

.challengeinfo-menu-item {
    display: block;
    width: 100%;
    padding: 16px 24px;
    text-decoration: none;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.challengeinfo-menu-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.logout-btn {
    color: #ff6b6b;
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff5252;
}


/* 메뉴 오버레이 */

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* 메인 컨텐츠 */

.main-content {
    margin-top: 120px;
    margin-bottom: 60px;
    min-height: calc(100vh - 180px);
    padding-top: 24px;
}


/* 모바일에서 메인 컨텐츠 마진 조정 */

@media (max-width: 480px) {
    .main-content {
        margin-top: 110px;
        min-height: calc(100vh - 170px);
        padding-top: 20px;
    }
}


/* 슬라이더 섹션 */


/* ============== 슬라이더 섹션 (4:3 비율 반응형) ============== */

.slider-section {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.slider-container {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    background: #f5f5f5;
    /* iOS WebKit compatibility */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.slider-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.5s ease;
}

.slide {
    position: relative;
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
    /* iOS WebKit 호환성 - 하드웨어 가속 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.slide[data-link] {
    cursor: pointer;
}

.slide[data-link]:active {
    opacity: 0.9;
}

.slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    /* iOS WebKit 호환성 */
    max-width: 100%;
    max-height: 100%;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.slide-content {
    position: absolute;
    bottom: 30px;
    left: 24px;
    color: white;
    z-index: 10;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.slide-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.slide-content p {
    font-size: 1rem;
    opacity: 0.95;
}


/* 슬라이더 좌우 화살표 */

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
    padding: 0;
    line-height: 1;
}

.slider-arrow:hover {
    background: rgba(0, 0, 0, 0.6);
    opacity: 1;
}

.slider-arrow:active {
    transform: translateY(-50%) scale(0.92);
}

.slider-arrow-left {
    left: 10px;
}

.slider-arrow-right {
    right: 10px;
}


/* 슬라이더 인디케이터 */

.slider-indicators {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 20;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 14px;
    border-radius: 20px;
}

.slide-counter {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}


/* ============== 대시보드 섹션 ============== */

.dashboard-section {
    padding: 16px 0 0;
    background: #f5f5f5;
}


/* 대시보드 가로 배치 */

.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}


/* 레벨 카드 */

.level-card {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
    border: 1px solid #ddd6fe;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.level-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.level-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.xp-bar-container {
    width: 100%;
    height: 6px;
    background: #e8eaf6;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.xp-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.level-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.xp-text {
    font-size: 0.7rem;
    color: #999;
}

.level-detail-link {
    font-size: 0.7rem;
    color: #667eea;
    font-weight: 600;
}


/* 레벨 카드 링크 스타일 */

a.level-card {
    text-decoration: none;
    transition: all 0.3s ease;
}

a.level-card:active {
    transform: scale(0.97);
}


/* 챌린지 위젯 (가로 배치 내) */

#challengeWidget {
    display: flex;
}

.challenge-progress-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.challenge-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.challenge-progress-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
}

.challenge-progress-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: #667eea;
}

.challenge-bar-container {
    width: 100%;
    height: 8px;
    background: #e8eaf6;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.challenge-bar {
    height: 100%;
    background: linear-gradient(90deg, #00d4aa, #00b894);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.challenge-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.challenge-days-left {
    font-size: 0.7rem;
    color: #999;
}

.challenge-detail-link {
    font-size: 0.7rem;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}


/* 챌린지 미참여자 카드 */

.challenge-signup-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.challenge-signup-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.challenge-signup-btn {
    display: inline-block;
    background: white;
    color: #667eea;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s;
}

.challenge-signup-btn:active {
    transform: scale(0.95);
}


/* 출석체크 카드 */

.attendance-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(0, 200, 150, 0.1);
    border: 1px solid #bbf7d0;
}

.attendance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.attendance-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.attendance-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.attendance-streak {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ff9800;
}

.attendance-detail-link {
    font-size: 0.75rem;
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.attendance-week {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
}

.attendance-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.attendance-day-label {
    font-size: 0.7rem;
    color: #999;
}

.attendance-day-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #aaa;
    transition: all 0.3s;
}

.attendance-day-circle.checked {
    background: linear-gradient(135deg, #00d4aa, #00b894);
    color: white;
    font-size: 1rem;
}

.attendance-day-circle.today {
    border: 2px solid #667eea;
    background: #f0f4ff;
    color: #667eea;
    font-weight: 700;
}

.attendance-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.attendance-btn:active {
    transform: scale(0.98);
}

.attendance-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: default;
}

.attendance-btn:disabled:active {
    transform: none;
}


/* 비로그인 안내 */

.login-prompt-section {
    padding: 16px 0 0;
    background: #f5f5f5;
}

.login-prompt-card {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    border: 1px solid #bfdbfe;
    text-align: center;
}

.login-prompt-text {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 14px;
}

.login-prompt-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 28px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s;
}

.login-prompt-btn:active {
    transform: scale(0.95);
}


/* 컨텐츠 섹션 */

.content-section {
    padding: 16px 0 30px;
    background: #f5f5f5;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}


/* 메뉴 그리드 */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.challengeinfo-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    padding: 16px 8px;
    border-radius: 14px;
    background: #f8f9ff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.challengeinfo-menu-item:active {
    transform: scale(0.95);
}


/* 메뉴 아이템 색상 변형 */

.menu-item-orange {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    border: 1px solid #fed7aa;
}

.menu-item-orange:active {
    background: linear-gradient(135deg, #ffedd5, #fddcab);
}

.menu-item-orange .challengeinfo-menu-label {
    color: #c2410c;
}

.menu-item-blue {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #bfdbfe;
}

.menu-item-blue:active {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.menu-item-blue .challengeinfo-menu-label {
    color: #1d4ed8;
}

.menu-item-pink {
    background: linear-gradient(135deg, #fdf2f8, #fce7f3);
    border: 1px solid #fbcfe8;
}

.menu-item-pink:active {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
}

.menu-item-pink .challengeinfo-menu-label {
    color: #be185d;
}

.menu-item-purple {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border: 1px solid #ddd6fe;
}

.menu-item-purple:active {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
}

.menu-item-purple .challengeinfo-menu-label {
    color: #7c3aed;
}

.menu-item-green {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #a7f3d0;
}

.menu-item-green:active {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}

.menu-item-green .challengeinfo-menu-label {
    color: #047857;
}

.challengeinfo-menu-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.challengeinfo-menu-icon-special {
    width: 100%;
    max-width: 56px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.2rem, 6.5vw, 2rem);
    font-weight: 700;
    color: #667eea;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.challengeinfo-menu-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    color: #333;
}


/* 540px 이상에서 최대 크기 제한 */

@media (min-width: 540px) {
    .menu-grid {
        gap: 16px;
        padding: 24px;
    }
}


/* 호버 효과 (데스크톱) */

@media (hover: hover) and (pointer: fine) {
    .challengeinfo-menu-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    .challengeinfo-menu-item:hover .challengeinfo-menu-icon {
        transform: scale(1.15);
    }
    .challengeinfo-menu-item:hover .challengeinfo.challengeinfo-menu-icon-special {
        transform: scale(1.15);
    }
}


/* 바로가기 리스트 (가로형) */

.quick-links {
    margin-top: 12px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.quick-link-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.quick-link-item:last-child {
    border-bottom: none;
}

.quick-link-item:active {
    background: rgba(102, 126, 234, 0.06);
}

.quick-link-icon {
    font-size: 1.4rem;
    width: 36px;
    flex-shrink: 0;
}

.quick-link-label {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.quick-link-arrow {
    font-size: 1.3rem;
    color: #ccc;
    font-weight: 300;
}

.quick-link-item:nth-child(1) {
    border-left: 3px solid #667eea;
}

.quick-link-item:nth-child(2) {
    border-left: 3px solid #00d4aa;
}

.quick-link-item:nth-child(3) {
    border-left: 3px solid #ff9800;
}

.quick-link-item:nth-child(4) {
    border-left: 3px solid #e91e63;
}

.quick-link-item:nth-child(5) {
    border-left: 3px solid #9c27b0;
}

.quick-link-item:nth-child(6) {
    border-left: 3px solid #4caf50;
}

.quick-link-item:nth-child(7) {
    border-left: 3px solid #2196f3;
}

@media (hover: hover) and (pointer: fine) {
    .quick-link-item:hover {
        background: rgba(102, 126, 234, 0.04);
    }
}


/* 예시 컨텐츠 카드 */

.content-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.content-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.card-description {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
}


/* 터치 디바이스 최적화 */

@media (hover: none) and (pointer: coarse) {
    .content-card:active {
        transform: scale(0.98);
    }
    .challengeinfo-menu-item:active {
        background: rgba(102, 126, 234, 0.2);
    }
}


/* 하단 네비게이션 바 */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 540px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 0 8px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #999;
    transition: all 0.3s ease;
    padding: 2px 8px;
    min-width: 50px;
    position: relative;
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-icon {
    font-size: 1.3rem;
    margin-bottom: 2px;
    transition: all 0.3s ease;
}

.nav-label {
    font-size: 0.65rem;
    font-weight: 500;
    transition: all 0.3s ease;
}


/* 활성화된 메뉴 */

.nav-item.active {
    color: #667eea;
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-item.active .nav-label {
    font-weight: 700;
}


/* 메인 아이콘 (가운데) */

.main-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    margin-bottom: 0;
}

.nav-item:nth-child(3) {
    margin-top: -16px;
}

.nav-item:nth-child(3) .nav-label {
    display: none;
}


/* 호버 효과 (데스크톱) */

@media (hover: hover) and (pointer: fine) {
    .nav-item:hover {
        color: #667eea;
    }
    .nav-item:hover .nav-icon {
        transform: scale(1.15);
    }
    .nav-item:hover .main-icon {
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    }
}


/* 아이폰 하단 안전 영역 고려 */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
}


/* ============== 관리자 슬라이드 관리 버튼 ============== */

.admin-slide-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.admin-slide-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}


/* ============== 슬라이드 관리 모달 ============== */

.slide-manager {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.slide-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.slide-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.slide-item-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.slide-preview {
    width: 100%;
    height: 200px;
    background: #fff;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
}

.slide-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-preview .no-image {
    color: #999;
    font-size: 0.9rem;
}

.upload-slide-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-slide-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.delete-slide-btn {
    padding: 6px 12px;
    background: #ffebee;
    color: #c62828;
    border: 2px solid #c62828;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.delete-slide-btn:hover {
    background: #c62828;
    color: white;
}


/* 슬라이드 추가 섹션 */

.add-slide-section {
    text-align: center;
    padding: 20px;
    background: #f0f4ff;
    border-radius: 12px;
    margin-bottom: 20px;
}

.add-slide-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.add-slide-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.help-text {
    margin: 10px 0 0 0;
    color: #666;
    font-size: 0.9rem;
}

.slide-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.slide-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.move-slide-btn {
    width: 35px;
    height: 35px;
    padding: 0;
    background: #e3f2fd;
    color: #1976d2;
    border: 2px solid #1976d2;
    border-radius: 6px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.move-slide-btn:hover:not(:disabled) {
    background: #1976d2;
    color: white;
}

.move-slide-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}


/* ============== 출석 달력 모달 ============== */

.calendar-container {
    background: white;
    border-radius: clamp(12px, 3vw, 20px);
    padding: clamp(1rem, 4vw, 2rem);
    overflow: visible;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.calendar-nav button {
    background: none;
    border: none;
    font-size: clamp(1.5rem, 4vw, 2rem);
    cursor: pointer;
    color: #667eea;
    padding: clamp(0.5rem, 2vw, 0.6rem);
    min-width: clamp(40px, 8vw, 45px);
    min-height: clamp(40px, 8vw, 45px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.calendar-nav button:hover {
    background: rgba(102, 126, 234, 0.1);
}

.calendar-nav h4 {
    margin: 0;
    color: #333;
    font-size: clamp(1.1rem, 3.5vw, 1.4rem);
    font-weight: 700;
    flex: 1;
    text-align: center;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: clamp(0px, 0.5vw, 3px);
    margin-bottom: clamp(0.5rem, 2vw, 0.8rem);
}

.calendar-weekdays>div {
    text-align: center;
    font-weight: 600;
    color: #666;
    padding: clamp(0.3rem, 2vw, 0.7rem);
    background: rgba(102, 126, 234, 0.05);
    border-radius: clamp(4px, 1vw, 6px);
    font-size: clamp(0.75rem, 2.5vw, 0.9rem);
}

#attendanceCalendarDays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: clamp(0px, 0.5vw, 0px);
    margin-bottom: clamp(1rem, 3vw, 20px);
}

#attendanceCalendarDays>div {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.7rem, 2.5vw, 1rem);
    font-weight: 600;
    border-radius: clamp(4px, 1.5vw, 6px);
    transition: all 0.3s ease;
    position: relative;
    min-height: clamp(35px, 8vw, 50px);
    background: #e9ecef;
    color: #333;
}

#attendanceCalendarDays>div.inactive {
    background: transparent;
    color: #ccc;
}

#attendanceCalendarDays>div.today {
    background: #667eea;
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#attendanceCalendarDays>div.attendance {
    background: linear-gradient(45deg, #51cf66, #40c057);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(81, 207, 102, 0.3);
}

#attendanceCalendarDays>div.future {
    background: transparent;
    color: #666;
}

.calendar-legend {
    margin-top: clamp(0.8rem, 2vw, 1.2rem);
    display: flex;
    justify-content: center;
    padding: clamp(0.5rem, 1.5vw, 1rem) clamp(0.8rem, 2.5vw, 1.5rem);
    background: rgba(102, 126, 234, 0.03);
    border-radius: clamp(6px, 1.5vw, 10px);
    border: 1px solid rgba(102, 126, 234, 0.08);
    max-width: clamp(240px, 50vw, 400px);
    margin-left: auto;
    margin-right: auto;
    align-items: center;
}

.calendar-legend span {
    font-size: clamp(0.7rem, 2.2vw, 1rem);
    color: #555;
    font-weight: 500;
    white-space: nowrap;
}

.legend-icon {
    width: clamp(10px, 2.5vw, 16px);
    height: clamp(10px, 2.5vw, 16px);
    flex-shrink: 0;
    border-radius: 3px;
}


/* 출석 통계 */

.attendance-calendar-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding: 0;
    gap: 8px;
}

.attendance-stat-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.attendance-stat-label {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

.attendance-stat-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}


/* 모달 오버레이/컨텐츠 (공용) */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.modal-content {
    background: white;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0.5;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.2rem;
    color: #333;
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
    border-radius: 8px;
}

.modal-close-btn:hover {
    color: #333;
    background: #f5f5f5;
}

.modal-close-btn:active {
    background: #eee;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

@media (max-width: 768px) {
    .slide-preview {
        height: 150px;
    }
}