/* ================================================
   Irion Fansite - Snow & Ice Theme ❄️
   Modern Glassmorphism Design
   ================================================ */

/* CSS Variables - Dark Theme Only */
:root {
    /* Simple Snow Theme ❄️ */
    --primary: #22D3EE;
    --primary-dark: #06B6D4;
    --primary-light: #67E8F9;
    --secondary: #0C4A6E;
    --accent: #38BDF8;

    --bg-dark: #0A1628;
    --bg-darker: #08111f;
    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --text-primary: #F0F9FF;
    --text-secondary: #BAE6FD;
    --text-muted: #7DD3FC;
    --border-color: rgba(34, 211, 238, 0.15);
    --border-glow: rgba(34, 211, 238, 0.4);

    --header-bg: rgba(10, 22, 40, 0.7);
    --modal-overlay-bg: rgba(0, 0, 0, 0.8);

    /* Clean Shadows - Simplified for performance */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(34, 211, 238, 0.3);

    --font-main: 'Noto Sans KR', -apple-system, sans-serif;
    --header-height: 70px;
    --container-width: 1200px;
    --transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--bg-dark);
    /* 스크롤 최적화 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
    overflow-x: hidden;
    /* 스크롤 성능 최적화 */
    -webkit-overflow-scrolling: touch;
}

/* 부드러운 스크롤바 스타일링 */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.3);
    border-radius: 6px;
    border: 2px solid rgba(15, 23, 42, 0.5);
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(34, 211, 238, 0.5);
}

/* GPU 가속 최적화 */
.header,
.hero,
.modal,
.modal-content,
.card,
.btn,
.nav-link,
.profile-card-main,
.clips-grid > *,
.videos-grid > * {
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 성능 최적화 - Containment */
.card,
.info-card,
.clip-card,
.video-card {
    contain: layout style paint;
}

.header {
    contain: layout style;
}

/* 눈송이 애니메이션 제거 - 성능 최적화 */

/* FOUC 방지 */
body.preload * {
    transition: none !important;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all var(--transition);
}

a:hover {
    color: var(--primary);
    will-change: color;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
}

button:hover {
    will-change: transform;
}

input, select, textarea {
    font-family: inherit;
}

/* 부드러운 스크롤 컨테이너 */
.container {
    will-change: transform;
}

/* 애니메이션 성능 최적화 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* ================================================
   Header - Glassmorphism ✨
   ================================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 12px rgba(6, 182, 212, 0.08);
    z-index: 1000;
    transition: all var(--transition);
    will-change: transform;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-glow), transparent);
    opacity: 0.5;
}

.header-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 8px;
    transition: all var(--transition);
}

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

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    position: relative;
}

.logo-text::after {
    content: '❄️';
    position: absolute;
    right: -25px;
    top: -5px;
    font-size: 0.9rem;
    animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: rotate(0deg) scale(1); }
    50% { opacity: 0.6; transform: rotate(180deg) scale(1.1); }
}

.logo-sub {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transform: translateX(-50%);
    transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: var(--bg-card);
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 80%;
}

.nav-link.active {
    font-weight: 600;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 30px;
    height: 30px;
    background: transparent;
    padding: 0;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition);
}

.mobile-menu-btn:hover span {
    background: var(--primary);
}

/* ================================================
   Section Titles ❄️
   ================================================ */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    position: relative;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin-left: 1rem;
}

.title-icon {
    font-size: 1.75rem;
}

/* ================================================
   Buttons - Clean Style 💎
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    will-change: transform, box-shadow;
    transform: translateZ(0);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    font-size: 1.125rem;
}

/* ================================================
   Cards - Glassmorphism 🧊
   ================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--border-glow);
}

/* ================================================
   Responsive Design 📱
   ================================================ */
@media (max-width: 768px) {
    /* 모바일에서 will-change 제거 - 메모리 절약 */
    .container {
        will-change: auto;
    }

    .header {
        will-change: auto;
    }

    .btn {
        will-change: auto;
    }

    .card {
        will-change: auto;
    }

    /* 모바일에서 애니메이션 duration 단축 */
    :root {
        --transition: 0.3s ease;
    }

    .nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--header-bg);
        padding: 1rem;
        gap: 0.5rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        border-bottom: 1px solid var(--border-color);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-btn {
        display: flex;
        -webkit-tap-highlight-color: transparent;
    }

    .section-title {
        font-size: 1.5rem;
    }

    /* 터치 디바이스 최적화 */
    .btn {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .btn:active {
        transform: scale(0.97);
    }

    .card {
        -webkit-tap-highlight-color: transparent;
    }

    /* 터치 디바이스에서 호버 효과 제거 */
    @media (hover: none) and (pointer: coarse) {
        .card:hover {
            transform: none;
            box-shadow: var(--shadow-md);
        }

        .btn:hover {
            transform: none;
        }

        .logo:hover {
            transform: none;
        }

        /* 탭 시에만 피드백 */
        .card:active {
            transform: scale(0.98);
            transition: transform 0.1s ease;
        }
    }
}

/* ================================================
   Utility Classes ✨
   ================================================ */
.text-gradient {
    color: var(--primary);
}

.glow {
    box-shadow: var(--shadow-glow);
}

.frost {
    /* backdrop-filter removed for performance */
}

/* ================================================
   Modal - Centered Layout
   ================================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    overflow-y: auto;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    margin: auto;
}

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 24px;
    font-weight: 400;
    color: rgba(240, 249, 255, 0.8);
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-close:hover {
    background: linear-gradient(135deg,
        rgba(34, 211, 238, 0.3) 0%,
        rgba(99, 102, 241, 0.3) 100%);
    border-color: rgba(34, 211, 238, 0.4);
    color: #F0F9FF;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 16px rgba(34, 211, 238, 0.3);
}

.modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* ================================================
   Footer - Professional Disclaimer
   ================================================ */
.footer {
    padding: 60px 20px 40px;
    text-align: center;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 600px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--border-color) 20%,
        var(--border-glow) 50%,
        var(--border-color) 80%,
        transparent 100%);
}

.footer-disclaimer {
    margin-bottom: 32px;
    padding: 28px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 800px;
    margin: 0 auto 32px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.footer-disclaimer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(34, 211, 238, 0.3) 20%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(34, 211, 238, 0.3) 80%,
        transparent 100%);
}

.disclaimer-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 50px;
    margin-bottom: 16px;
    transition: all var(--transition-fast);
}

.disclaimer-badge:hover {
    background: rgba(34, 211, 238, 0.15);
    border-color: rgba(34, 211, 238, 0.5);
    transform: translateY(-2px);
}

.badge-icon {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: bold;
}

.badge-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.disclaimer-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0;
    opacity: 0.9;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--border-color) 50%,
        transparent 100%);
    margin: 32px auto;
    max-width: 400px;
}

.footer-text {
    text-align: center;
    line-height: 1.8;
    color: var(--text-secondary);
    opacity: 0.85;
}

.footer-text a {
    transition: opacity var(--transition-fast);
    font-weight: 600;
}

.footer-text a:hover {
    opacity: 1;
    color: var(--primary-light);
}

@media (max-width: 768px) {
    .footer-disclaimer {
        padding: 20px 24px;
        margin-bottom: 24px;
    }

    .disclaimer-text {
        font-size: 0.875rem;
    }
}
