@charset "UTF-8";

/* ==========================================================================
   🎨 테마 변수 설정
   ========================================================================== */

:root, [data-theme="light"] {
    --theme-color: #f8fafc; /* 상단 시스템 상태바 색상 */
    --bg-color: #f8fafc;
    --bg-gradient: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.05) 40%, rgba(255, 255, 255, 0) 70%);
    --text-color: #0f172a;
    --text-sub: #64748b;
    --header-bg: rgba(255, 255, 255, 0.85);
    --header-border: rgba(226, 232, 240, 0.8);
    --brand-gradient: linear-gradient(135deg, #1e293b, #475569);
    --card-bg: #ffffff;
    --card-border: rgba(226, 232, 240, 0.8);
    --card-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    --search-bg: rgba(255, 255, 255, 0.9);
    --search-border: rgba(226, 232, 240, 0.8);
    --search-text: #0f172a;
    --search-focus-bg: #ffffff;
    --autocomplete-bg: #ffffff;
    --autocomplete-border: #e2e8f0;
    --autocomplete-hover: #f1f5f9;
    --badge-bg: #e2e8f0;
    --badge-text: #64748b;
    --btn-bg: #f1f5f9;
    --btn-text: #334155;
    --btn-border: #e2e8f0;
    --btn-hover-bg: #e2e8f0;
    --footer-bg: #ffffff;
    --footer-border: #e2e8f0;
    --overlay-bg: rgba(255, 255, 255, 0.94);
    --spinner-border: #e2e8f0;
    --drawer-bg: #ffffff;
}

[data-theme="dark"] {
    --theme-color: #0b0f19; /* 상단 시스템 상태바 색상 */
    --bg-color: #0b0f19;
    --bg-gradient: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, rgba(165, 94, 234, 0.1) 40%, rgba(11, 15, 25, 0) 70%);
    --text-color: #f8fafc;
    --text-sub: #94a3b8;
    --header-bg: rgba(15, 23, 42, 0.85);
    --header-border: rgba(255, 255, 255, 0.08);
    --brand-gradient: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    --card-bg: rgba(30, 41, 59, 0.5);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --search-bg: rgba(30, 41, 59, 0.7);
    --search-border: rgba(255, 255, 255, 0.12);
    --search-text: #ffffff;
    --search-focus-bg: rgba(30, 41, 59, 0.95);
    --autocomplete-bg: rgba(15, 23, 42, 0.95);
    --autocomplete-border: rgba(255, 255, 255, 0.1);
    --autocomplete-hover: rgba(255, 255, 255, 0.08);
    --badge-bg: rgba(255, 255, 255, 0.1);
    --badge-text: #94a3b8;
    --btn-bg: rgba(255, 255, 255, 0.08);
    --btn-text: #f1f5f9;
    --btn-border: rgba(255, 255, 255, 0.1);
    --btn-hover-bg: rgba(255, 255, 255, 0.15);
    --footer-bg: #080c14;
    --footer-border: rgba(255, 255, 255, 0.08);
    --overlay-bg: rgba(11, 15, 25, 0.94);
    --spinner-border: rgba(255, 255, 255, 0.1);
    --drawer-bg: #0f172a;
}

/* ==========================================================================
   🌐 기본 초기화
   ========================================================================== */

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    scroll-behavior: smooth;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 🌟 GNB & 상단 헤더 (상단 Safe Area 대응 적용) */
.top-navigation-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px 16px;
    width: 100%;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--header-border);
    box-sizing: border-box;
}

.brand-logo {
    justify-self: center;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-color);
    background: var(--brand-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.brand-logo img,
.brand-logo svg {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.auth-container { 
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 🎁 상단바 일일보상 위젯 (모바일 줄바꿈 방지) */
.header-reward-badge {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #f59e0b;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.header-reward-badge:hover {
    background: rgba(245, 158, 11, 0.2);
    transform: translateY(-1px);
}

.header-profile-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.theme-toggle-btn, .menu-toggle-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--text-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.theme-toggle-btn:hover, .menu-toggle-btn:hover {
    background: var(--btn-hover-bg);
    transform: scale(1.05);
}

.btn-login-trigger {
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    padding: 6px 14px;
    border-radius: 30px;
    color: var(--btn-text);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   📁 사이드 메뉴
   ========================================================================== */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu-drawer {
    position: fixed;
    top: 0;
    right: -350px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: var(--drawer-bg);
    z-index: 999;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    padding: calc(20px + env(safe-area-inset-top, 0px)) 20px 20px 20px;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid var(--card-border);
}

.side-menu-drawer.active {
    right: 0 !important;
}

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 14px;
}

.side-menu-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.btn-close-menu {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}

.side-menu-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.side-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-color);
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.side-menu-item:hover {
    background: var(--btn-hover-bg);
    border-color: var(--item-color, #6366f1);
}

.side-menu-icon {
    font-size: 1.2rem;
}

.side-menu-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.side-menu-title {
    font-size: 0.9rem;
    font-weight: 700;
}

.side-menu-desc {
    font-size: 0.75rem;
    color: var(--text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   🚀 히어로 섹션
   ========================================================================== */
.hero-section {
    position: relative;
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible !important;
    z-index: 10;
}

.hero-bg-glow {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: var(--bg-gradient);
    z-index: -1;
    filter: blur(50px);
    pointer-events: none;
}

.symbol-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    margin-bottom: 16px;
    cursor: pointer;
}

.hero-graphic-box {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: floatAnim 4s ease-in-out infinite;
}

.hero-graphic-box svg {
    width: 90px;
    height: 90px;
    object-fit: contain;
}

.hero-graphic-box img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

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

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 8px;
    color: var(--text-color);
    background: var(--brand-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 0.95rem;
    color: var(--text-sub);
    margin-bottom: 24px;
    font-weight: 500;
}

/* 🔍 검색창 & 자동완성 박스 */
.main-search-wrapper {
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 500;
}

.main-search-input {
    width: 100%;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 100px;
    border: 2px solid var(--search-border);
    background: var(--search-bg);
    outline: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    color: var(--search-text);
    transition: all 0.25s ease;
}

.main-search-input:focus {
    border-color: #6366f1;
    background: var(--search-focus-bg);
}

.autocomplete-box {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--autocomplete-bg);
    border-radius: 18px;
    border: 1px solid var(--autocomplete-border);
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1000;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
    display: none;
    padding: 8px;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 12px;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.autocomplete-item:hover {
    background-color: var(--autocomplete-hover);
    color: #6366f1;
}

.autocomplete-item .category-badge {
    font-size: 0.72rem;
    background: var(--badge-bg);
    padding: 4px 8px;
    border-radius: 8px;
    color: var(--badge-text);
    flex-shrink: 0;
}

/* ==========================================================================
   🎮 피드 그리드
   ========================================================================== */
.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 60px 16px;
    width: 100%;
}

.section-header {
    text-align: left;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-color);
}

.section-header p {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-top: 2px;
}

.feed-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    width: 100%;
}

.feed-card {
    background: var(--card-bg);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    transform: translateY(0);
}

.feed-card.reveal {
    opacity: 1;
    transform: translateY(0);
}

.feed-card:hover {
    transform: translateY(-4px);
    border-color: #6366f1;
}

.feed-media-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-media-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.feed-placeholder {
    font-size: 2.2rem;
    opacity: 0.6;
}

.feed-card-info {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.feed-title-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-arrow {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--btn-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.feed-card:hover .card-arrow {
    background: #6366f1;
    color: #ffffff;
}

/* ==========================================================================
   📢 공지사항 모달
   ========================================================================== */
.notice-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.notice-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.notice-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    width: 90%;
    max-width: 440px;
    padding: 24px 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.notice-modal-header {
    margin-bottom: 16px;
}

.notice-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #818cf8;
    background: rgba(129, 140, 248, 0.15);
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.notice-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.4;
    word-break: keep-all;
}

.notice-modal-body {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-color);
    word-break: keep-all;
    overflow-wrap: break-word;
    margin-bottom: 20px;
}

.notice-modal-footer {
    display: flex;
    justify-content: flex-end;
}

.btn-notice-close {
    width: 100%;
    background: #6366f1;
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-notice-close:hover {
    background: #4f46e5;
}

/* ==========================================================================
   🌐 푸터 및 로딩 오버레이
   ========================================================================== */
.global-footer {
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px)) 16px;
    font-size: 13px;
    color: var(--text-sub);
    background: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    text-align: center;
    margin-top: auto;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--spinner-border);
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
}

/* ==========================================================================
   📌 스테이션 전용 모달 스타일
   ========================================================================== */
.station-modal-content {
    text-align: center;
}

.station-modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.station-modal-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 4px;
}

.station-modal-footer {
    display: flex;
    gap: 10px;
}

.btn-station-secondary {
    flex: 1;
    background: var(--btn-bg);
    color: var(--text-color);
    border: 1px solid var(--btn-border);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-station-secondary:hover {
    background: var(--btn-hover-bg);
}

.btn-station-primary {
    flex: 1.5;
    background: #6366f1;
    color: #ffffff;
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-station-primary:hover {
    opacity: 0.9;
}

/* ==========================================================================
   📱 사이드 메뉴 로그인 및 아코디언 서브메뉴
   ========================================================================== */
.side-menu-auth-box {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

.btn-side-auth {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    background: #6366f1;
    color: #ffffff;
    border: none;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-side-auth:hover {
    background: #4f46e5;
}

.side-menu-accordion-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.accordion-toggle-icon {
    font-size: 1.1rem;
    font-weight: 800;
    margin-left: auto;
    color: var(--text-sub);
    transition: transform 0.2s ease;
}

.side-sub-menu {
    max-height: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0 0 12px 12px;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
    display: flex;
    flex-direction: column;
    margin-top: -4px;
    margin-bottom: 6px;
}

.side-sub-menu.active {
    max-height: 500px;
    transition: max-height 0.3s ease-in-out;
    padding: 6px 0;
    border: 1px solid var(--card-border);
    border-top: none;
}

.sub-menu-item {
    padding: 10px 16px 10px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s ease;
}

.sub-menu-item:hover {
    background: var(--btn-hover-bg);
    color: #6366f1;
}

.sub-menu-item.filter-all-btn {
    color: #818cf8;
    font-weight: 700;
    border-bottom: 1px dashed var(--card-border);
}

.sub-menu-item.empty {
    color: var(--text-sub);
    font-size: 0.8rem;
    cursor: default;
}

.sub-arrow {
    font-size: 0.75rem;
    opacity: 0.5;
}

.section-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-reset-filter {
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--text-color);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.empty-feed-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: var(--text-sub);
    font-size: 0.95rem;
}

/* ==========================================================================
   📱 반응형 미디어 쿼리
   ========================================================================== */
@media (max-width: 480px) {
    .feed-grid-layout {
        grid-template-columns: 1fr;
    }
    
    .top-navigation-bar {
        padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px 10px;
    }
    
    .auth-container {
        gap: 4px;
    }
    
    .header-reward-badge {
        padding: 3px 6px;
        font-size: 0.7rem;
    }
    
    .theme-toggle-btn, .menu-toggle-btn {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
}
