/**
 * 책나무(BookTree) 메인 스타일시트
 * 자연 친화적 인터랙티브 미니멀리즘
 */

/* ============================================================
   CSS Variables - 컬러 스킴
   ============================================================ */
:root {
    --forest-green: #228B22;
    --forest-green-dark: #1a6b1a;
    --forest-green-light: #2ecc40;
    --soft-beige: #F5EFD8;
    --soft-beige-dark: #E8DFC8;
    --moss-green: #A5C09A;
    --earth-brown: #8B7355;
    --earth-brown-light: #A68B6A;
    --sky-blue: #A7D8F4;
    --sky-blue-dark: #7BC4ED;
    --white: #FFFFFF;
    --black: #1a1a1a;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;

    /* 3D 안티그래비티 그림자 */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow: 0 8px 24px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 16px 32px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 24px 48px rgba(0,0,0,0.15), 0 12px 24px rgba(0,0,0,0.1);
    --shadow-xl: 0 32px 64px rgba(0,0,0,0.2), 0 16px 32px rgba(0,0,0,0.12);

    /* 3D 부유 그림자 */
    --shadow-float: 0 20px 40px rgba(34, 139, 34, 0.15), 0 10px 20px rgba(0,0,0,0.1);
    --shadow-float-lg: 0 30px 60px rgba(34, 139, 34, 0.2), 0 15px 30px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 40px rgba(34, 139, 34, 0.15);

    /* 텍스트 그림자 */
    --text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --text-shadow-lg: 0 4px 8px rgba(0,0,0,0.15);

    /* 트랜지션 */
    --transition-fast: 0.15s ease;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* 폰트 */
    --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    --font-display: 'Gmarket Sans', 'Pretendard', sans-serif;

    /* 레이아웃 */
    --max-width: 1200px;
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --border-radius-full: 9999px;

    /* 3D 퍼스펙티브 */
    --perspective: 1000px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--soft-beige);
    color: var(--black);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    perspective: var(--perspective);
    perspective-origin: center top;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

ul, ol {
    list-style: none;
}

/* ============================================================
   Typography - 3D 텍스트 효과
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.3;
    color: var(--forest-green-dark);
    text-shadow: var(--text-shadow);
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    text-shadow: var(--text-shadow-lg);
}
h2 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    text-shadow: var(--text-shadow-lg);
}
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ============================================================
   Layout Components
   ============================================================ */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 4rem 0;
}

/* ============================================================
   Header - 3D 플로팅
   ============================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.05);
    transition: var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

.site-header.scrolled {
    box-shadow: 0 8px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    background: rgba(255, 255, 255, 0.95);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--forest-green);
}

.logo-icon {
    width: 40px;
    height: 40px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--gray-700);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--forest-green);
    transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--forest-green);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    cursor: pointer;
    background: none;
    border: none;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--forest-green);
    transition: var(--transition-fast);
}

/* ============================================================
   Buttons - 3D 안티그래비티
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-bounce);
    white-space: nowrap;
    position: relative;
    transform-style: preserve-3d;
}

.btn-primary {
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--forest-green-dark) 100%);
    color: var(--white);
    box-shadow: 0 8px 24px rgba(34, 139, 34, 0.35),
                0 4px 8px rgba(0,0,0,0.1),
                inset 0 1px 0 rgba(255,255,255,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(34, 139, 34, 0.4),
                0 8px 16px rgba(0,0,0,0.12),
                inset 0 1px 0 rgba(255,255,255,0.3);
}

.btn-primary:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 4px 16px rgba(34, 139, 34, 0.3),
                0 2px 4px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: rgba(255,255,255,0.9);
    color: var(--forest-green);
    border: 2px solid var(--forest-green);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1),
                0 3px 8px rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--forest-green);
    color: var(--white);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(34, 139, 34, 0.35),
                0 6px 12px rgba(0,0,0,0.1);
}

.btn-outline {
    background: rgba(255,255,255,0.5);
    color: var(--forest-green);
    border: 2px solid var(--forest-green);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: var(--forest-green);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(34, 139, 34, 0.3);
}

.btn-ghost {
    background: rgba(255,255,255,0.3);
    color: var(--gray-700);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.8);
    color: var(--forest-green);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    box-shadow: 0 10px 30px rgba(34, 139, 34, 0.35),
                0 5px 12px rgba(0,0,0,0.1);
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
}

/* ============================================================
   Cards - 3D 글래스모피즘
   ============================================================ */
.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-float),
                inset 0 0 0 1px rgba(255,255,255,0.5);
    overflow: hidden;
    transition: var(--transition);
    transform-style: preserve-3d;
    border: 1px solid rgba(255,255,255,0.3);
}

.card:hover {
    box-shadow: var(--shadow-float-lg),
                inset 0 0 0 1px rgba(255,255,255,0.6),
                var(--shadow-glow);
    transform: translateY(-8px) rotateX(2deg);
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    padding: 1.5rem 1.5rem 0;
}

.card-footer {
    padding: 0 1.5rem 1.5rem;
}

/* ============================================================
   Form Elements - 3D 인셋 효과
   ============================================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    text-shadow: 0 1px 1px rgba(255,255,255,0.5);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: var(--border-radius);
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06),
                0 2px 8px rgba(0,0,0,0.04);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--forest-green);
    background: rgba(255,255,255,0.95);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04),
                0 0 0 4px rgba(34, 139, 34, 0.15),
                0 4px 16px rgba(34, 139, 34, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: var(--gray-500);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-shadow: 0 1px 1px rgba(255,255,255,0.5);
}

.form-success {
    color: var(--forest-green);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-shadow: 0 1px 1px rgba(255,255,255,0.5);
}

/* ============================================================
   Hero Section - 3D 패럴랙스
   ============================================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--header-height);
    background: linear-gradient(135deg, var(--soft-beige) 0%, var(--soft-beige-dark) 50%, var(--moss-green) 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.4) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(34, 139, 34, 0.1) 0%, transparent 40%);
    z-index: 1;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-tree {
    position: absolute;
    bottom: 0;
    right: 5%;
    width: 40%;
    max-width: 500px;
    opacity: 0.15;
    animation: float 8s ease-in-out infinite;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.1));
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 700px;
    animation: heroFadeIn 1s ease-out;
}

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

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    color: var(--forest-green);
    border-radius: var(--border-radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08),
                inset 0 0 0 1px rgba(255,255,255,0.5);
    animation: floatBadge 3s ease-in-out infinite;
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 4px 12px rgba(0,0,0,0.1),
                 0 2px 4px rgba(0,0,0,0.05);
}

.hero-title .highlight {
    color: var(--forest-green);
    position: relative;
    text-shadow: 0 4px 16px rgba(34, 139, 34, 0.3),
                 0 2px 4px rgba(0,0,0,0.1);
}

.hero-description {
    font-size: 1.25rem;
    color: var(--gray-700);
    margin-bottom: 2rem;
    max-width: 600px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================================
   Stats Section - 3D 카운터
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    perspective: 1000px;
}

.stat-card {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-float),
                inset 0 0 0 1px rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.3);
    transition: var(--transition);
    transform-style: preserve-3d;
    animation: statFloat 4s ease-in-out infinite;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.5s; }
.stat-card:nth-child(3) { animation-delay: 1s; }
.stat-card:nth-child(4) { animation-delay: 1.5s; }

@keyframes statFloat {
    0%, 100% { transform: translateY(0) rotateX(0); }
    50% { transform: translateY(-8px) rotateX(2deg); }
}

.stat-card:hover {
    box-shadow: var(--shadow-float-lg), var(--shadow-glow);
    transform: translateY(-12px) rotateX(5deg) scale(1.02);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--forest-green);
    line-height: 1;
    text-shadow: 0 2px 8px rgba(34, 139, 34, 0.2);
}

.stat-label {
    color: var(--gray-700);
    margin-top: 0.5rem;
    font-size: 0.875rem;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

/* ============================================================
   Feature Section - 3D 플로팅 카드
   ============================================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    perspective: 1000px;
}

.feature-card {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    text-align: center;
    transition: var(--transition);
    transform-style: preserve-3d;
    box-shadow: var(--shadow-float),
                inset 0 0 0 1px rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.3);
    position: relative;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--border-radius-lg) + 2px);
    background: linear-gradient(135deg, rgba(255,255,255,0.5), transparent);
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-12px) rotateX(5deg) rotateY(-2deg);
    box-shadow: var(--shadow-float-lg), var(--shadow-glow);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--moss-green) 0%, var(--forest-green) 100%);
    border-radius: 50%;
    font-size: 2rem;
    box-shadow: 0 10px 30px rgba(34, 139, 34, 0.3),
                inset 0 1px 0 rgba(255,255,255,0.3);
    transform: translateZ(20px);
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { box-shadow: 0 10px 30px rgba(34, 139, 34, 0.3), inset 0 1px 0 rgba(255,255,255,0.3); }
    50% { box-shadow: 0 15px 40px rgba(34, 139, 34, 0.4), inset 0 1px 0 rgba(255,255,255,0.3); }
}

.feature-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    text-shadow: var(--text-shadow);
}

.feature-description {
    color: var(--gray-700);
    font-size: 0.9375rem;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

/* ============================================================
   Tree Growth Visualization - 3D 성장 효과
   ============================================================ */
.tree-container {
    position: relative;
    width: 200px;
    height: 250px;
    margin: 0 auto;
    perspective: 500px;
}

.tree-visual {
    text-align: center;
    font-size: 8rem;
    line-height: 1;
    filter: drop-shadow(0 20px 40px rgba(34, 139, 34, 0.3));
    animation: treeGrow 2s ease-out, treeFloat 4s ease-in-out 2s infinite;
    transform-style: preserve-3d;
}

@keyframes treeGrow {
    from {
        transform: scale(0.3) rotateY(-30deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotateY(0);
        opacity: 1;
    }
}

@keyframes treeFloat {
    0%, 100% { transform: translateY(0) rotateY(0); }
    25% { transform: translateY(-10px) rotateY(5deg); }
    75% { transform: translateY(-10px) rotateY(-5deg); }
}

.tree-level-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--forest-green-dark) 100%);
    color: var(--white);
    border-radius: var(--border-radius-full);
    font-weight: 700;
    margin-top: 1rem;
    box-shadow: 0 6px 20px rgba(34, 139, 34, 0.35),
                inset 0 1px 0 rgba(255,255,255,0.2);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(34, 139, 34, 0.35), inset 0 1px 0 rgba(255,255,255,0.2); }
    50% { box-shadow: 0 8px 30px rgba(34, 139, 34, 0.5), inset 0 1px 0 rgba(255,255,255,0.2); }
}

.progress-bar {
    height: 10px;
    background: rgba(0,0,0,0.1);
    border-radius: var(--border-radius-full);
    overflow: hidden;
    margin-top: 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--moss-green), var(--forest-green), var(--forest-green-light));
    border-radius: var(--border-radius-full);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(34, 139, 34, 0.4);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
    border-radius: var(--border-radius-full);
}

/* ============================================================
   Ranking Table - 3D 리더보드
   ============================================================ */
.ranking-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.ranking-table th,
.ranking-table td {
    padding: 1rem;
    text-align: left;
}

.ranking-table th {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

.ranking-table tbody tr {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.ranking-table tbody tr td:first-child {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.ranking-table tbody tr td:last-child {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.ranking-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateX(8px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1), var(--shadow-glow);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: var(--transition);
}

.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
    animation: goldShine 2s ease-in-out infinite;
}

@keyframes goldShine {
    0%, 100% { box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4); }
    50% { box-shadow: 0 8px 30px rgba(255, 193, 7, 0.6); }
}

.rank-2 {
    background: linear-gradient(135deg, #E8E8E8, #B0B0B0);
    color: #555;
    box-shadow: 0 6px 20px rgba(192, 192, 192, 0.4);
}

.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: #fff;
    box-shadow: 0 6px 20px rgba(205, 127, 50, 0.4);
}

.rank-default {
    background: rgba(255,255,255,0.8);
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--moss-green), var(--forest-green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(34, 139, 34, 0.2);
    transition: var(--transition);
}

.ranking-table tbody tr:hover .user-avatar {
    transform: scale(1.1) rotate(5deg);
}

.user-name {
    font-weight: 600;
    color: var(--gray-800);
}

.user-branch {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    background: var(--gray-800);
    color: var(--gray-300);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-brand {
    grid-column: span 2;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-description {
    font-size: 0.9375rem;
    line-height: 1.7;
}

.footer-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    color: var(--gray-400);
    font-size: 0.9375rem;
}

.footer-link:hover {
    color: var(--white);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--gray-700);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copyright {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.footer-legal {
    display: flex;
    gap: 1.5rem;
}

.footer-legal a {
    font-size: 0.875rem;
    color: var(--gray-400);
}

.footer-legal a:hover {
    color: var(--white);
}

/* ============================================================
   Auth Pages (Login, Register, etc.) - 3D 글래스모피즘
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--soft-beige) 0%, var(--soft-beige-dark) 50%, var(--moss-green) 100%);
    perspective: 1000px;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(34, 139, 34, 0.15) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(165, 192, 154, 0.2) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: float 10s ease-in-out infinite reverse;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 10;
    animation: authSlideIn 0.6s ease-out;
}

@keyframes authSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) rotateX(-5deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 32px 64px rgba(0,0,0,0.15),
                0 16px 32px rgba(0,0,0,0.1),
                inset 0 0 0 1px rgba(255,255,255,0.5);
    padding: 2.5rem;
    border: 1px solid rgba(255,255,255,0.3);
    transform-style: preserve-3d;
    transition: var(--transition);
}

.auth-card:hover {
    box-shadow: 0 40px 80px rgba(0,0,0,0.18),
                0 20px 40px rgba(0,0,0,0.12),
                inset 0 0 0 1px rgba(255,255,255,0.6),
                var(--shadow-glow);
    transform: translateY(-4px);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 8px 16px rgba(34, 139, 34, 0.2));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.auth-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-shadow: var(--text-shadow);
}

.auth-subtitle {
    color: var(--gray-700);
    font-size: 0.9375rem;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gray-300), transparent);
}

.auth-divider span {
    padding: 0 1rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.auth-footer p {
    color: var(--gray-700);
    font-size: 0.9375rem;
    margin: 0;
}

.auth-footer a {
    color: var(--forest-green);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================================
   Alert Messages - 3D 팝업 효과
   ============================================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1),
                inset 0 1px 0 rgba(255,255,255,0.5);
    animation: alertSlideIn 0.3s ease-out;
}

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

.alert-success {
    background: rgba(212, 237, 218, 0.9);
    color: #155724;
    border: 1px solid rgba(195, 230, 203, 0.8);
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.15),
                inset 0 1px 0 rgba(255,255,255,0.5);
}

.alert-error {
    background: rgba(248, 215, 218, 0.9);
    color: #721c24;
    border: 1px solid rgba(245, 198, 203, 0.8);
    box-shadow: 0 8px 24px rgba(220, 53, 69, 0.15),
                inset 0 1px 0 rgba(255,255,255,0.5);
}

.alert-warning {
    background: rgba(255, 243, 205, 0.9);
    color: #856404;
    border: 1px solid rgba(255, 238, 186, 0.8);
    box-shadow: 0 8px 24px rgba(255, 193, 7, 0.15),
                inset 0 1px 0 rgba(255,255,255,0.5);
}

.alert-info {
    background: rgba(209, 236, 241, 0.9);
    color: #0c5460;
    border: 1px solid rgba(190, 229, 235, 0.8);
    box-shadow: 0 8px 24px rgba(23, 162, 184, 0.15),
                inset 0 1px 0 rgba(255,255,255,0.5);
}

/* ============================================================
   Utility Classes
   ============================================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--forest-green); }
.text-muted { color: var(--gray-600); }
.text-small { font-size: 0.875rem; }
.text-tiny { font-size: 0.75rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ============================================================
   Responsive Design
   ============================================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-brand {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
        gap: 0;
    }

    .main-nav.active {
        display: flex;
    }

    .nav-link {
        padding: 1rem;
        border-bottom: 1px solid var(--gray-200);
        width: 100%;
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero {
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-tree {
        width: 60%;
        right: 20%;
        opacity: 0.1;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .auth-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 3rem 0;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }
}
