/* 
 * G-Toki MVP Phase 7: Clean Reboot CSS 
 * 톤앤매너: Toss/Daangn 스타일의 플랫하고 여백이 넓은 모던 UI
 */

:root {
    /* Color System */
    --primary-color: #00FF87;
    /* Neon Mint Point */
    --secondary-color: #00D589;
    /* Slightly darker mint for gradients if needed */

    --bg-base: #FFFFFF;
    /* 퓨어 화이트 배경 */
    --bg-surface: #F8F9FA;
    /* 아주 옅은 오프화이트 카드 배경 */
    --bg-surface-elevated: #FFFFFF;

    --text-primary: #111111;
    /* 퓨어 블랙에 가까운 텍스트 */
    --text-secondary: #495057;
    /* 부가 텍스트 */
    --text-tertiary: #868E96;
    /* 설명 텍스트 */

    --border-color: #F1F3F5;
    /* 아주 옅은 구분선 */

    /* Typography */
    --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Layout & Spacing */
    --safe-area-top: 44px;
    --safe-area-bottom: 84px;
    --border-radius-lg: 24px;
    /* 둥근 토스 스타일 모서리 */
    --border-radius-md: 16px;
    --border-radius-sm: 8px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);

    /* Transitions */
    --transition-fast: 0.2s ease-out;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* 1. Hide scrollbar for Chrome, Safari and Opera */
::-webkit-scrollbar {
    display: none;
}

/* 2. Hide scrollbar for IE, Edge and Firefox */
* {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

body {
    font-family: var(--font-family);
    background-color: #E9ECEF;
    /* 데스크톱 브라우저 배경 */
    color: var(--text-primary);
    line-height: 1.5;
    letter-spacing: -0.5px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Desktop Presentation Wrapper */
.presentation-wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.device-frame {
    width: 390px;
    height: 844px;
    background-color: var(--bg-base);
    border-radius: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Status Bar */
.status-bar {
    height: var(--safe-area-top);
    background-color: var(--bg-base);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 600;
    z-index: 100;
}

.status-bar .icons {
    display: flex;
    gap: 4px;
}

.status-bar .icons span {
    font-size: 16px;
}

/* App Container */
.app-container {
    flex: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--bg-base);
}

/* Views */
.view {
    display: none;
    width: 100%;
    min-height: 100%;
    padding-bottom: var(--safe-area-bottom);
    background-color: var(--bg-base);
    animation: fadeIn var(--transition-fast) forwards;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 5-Tab GNB (Bottom Navigation) */
.bottom-nav {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: var(--safe-area-bottom);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: 20px;
    /* iOS Safe Area padding */
    z-index: 90;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    text-decoration: none;
    cursor: pointer;
    transition: color var(--transition-fast);
    padding: 10px;
}

.nav-item .material-symbols-rounded {
    font-size: 28px;
    margin-bottom: 0;
    font-weight: 300;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active .material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 700;
}

/* Common Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--bg-base);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -1px;
}

.header-actions .material-symbols-rounded {
    font-size: 24px;
    color: var(--text-primary);
    margin-left: 12px;
    cursor: pointer;
}

/* Common Typography */
h1,
h2,
h3 {
    color: var(--text-primary);
}

h1 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 16px;
}

h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Placeholder Content specific to views (to be built out in next steps) */
.content-padding {
    padding: 0 24px 24px 24px;
}

.pb-scroll {
    padding-bottom: 120px;
    /* To prevent overlapping with nav bar */
}

/* Utilities */
.text-center {
    text-align: center;
}

/* =========================================================
   3. Lucky Draw (Campaign) View
   ========================================================= */

.timer-badge {
    display: inline-block;
    background-color: #E9ECEF;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    margin-top: 16px;
    margin-bottom: 24px;
}

.massive-timer {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 40px;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
}

.time-num {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
    letter-spacing: -2px;
}

.time-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 8px;
}

.time-colon {
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
    color: #DEE2E6;
    margin-top: -4px;
}

.lucky-product-showcase {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 32px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lucky-product-showcase .bg-circle {
    position: absolute;
    width: 260px;
    height: 260px;
    background-color: #E9ECEF;
    border-radius: 50%;
    z-index: 1;
}

.lucky-product-showcase .product-img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    /* Make square background blend in */
}

.price-badge {
    position: absolute;
    top: 10px;
    right: 20px;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #00FF87, #60EFFF);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    font-weight: 800;
    color: #000;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0, 255, 135, 0.4);
}

.price-badge .won {
    font-size: 16px;
    margin-left: 2px;
    margin-top: 8px;
}

.product-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 0;
}

/* =========================================================
   5. My Page (Membership) View
   ========================================================= */

.mypage-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.mypage-title .highlight {
    color: var(--primary-color);
}

.mypage-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.mypage-mascot-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
}

.mypage-mascot {
    width: 250px;
    object-fit: contain;
}

.distance-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.distance-number {
    font-size: 72px;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1;
    letter-spacing: -3px;
    margin-bottom: 8px;
}

.distance-number .unit {
    font-size: 40px;
    margin-left: 4px;
    letter-spacing: -1px;
}

.distance-desc {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Weekly Calendar */
.weekly-calendar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
}

.day-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.day-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.day-check {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.day-check.active {
    background-color: #E9ECEF;
}

.day-check.active .material-symbols-rounded {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.day-check.empty {
    background-color: #F8F9FA;
    border: 2px solid #E9ECEF;
}

/* Action Rows & Buttons */
.action-row {
    display: flex;
    gap: 12px;
}

.btn-outline-primary {
    padding: 18px;
    border-radius: var(--border-radius-lg);
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    border: 1px solid var(--primary-color);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.float-badge {
    position: absolute;
    top: -15px;
    right: 15px;
    background-color: var(--bg-base);
    color: var(--text-primary);
    border: 2px solid var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.mt-32 {
    margin-top: 32px;
}

/* Primary Button */
.btn-primary {
    width: 100%;
    padding: 18px;
    border-radius: var(--border-radius-lg);
    background: var(--primary-color);
    color: #000;
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-primary:disabled {
    background: #E9ECEF;
    color: var(--text-tertiary);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* =========================================================
   0. Splash & Onboarding Views
   ========================================================= */

/* Splash Screen */
.splash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-base);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.splash-overlay.active {
    display: flex;
}

.splash-logo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    animation: splashFloat 3s ease-in-out infinite;
}

@keyframes splashFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Onboarding */
.onboarding-title {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.onboarding-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
}

.taste-orbs-container {
    position: relative;
    height: 400px;
    /* Space for absolute positioning */
}

.taste-orb {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    user-select: none;
    animation: orbFloat 4s ease-in-out infinite;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translateY(0px) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.02);
    }
}

.taste-orb.selected {
    background-color: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
    transform: scale(1.05) !important;
    box-shadow: 0 8px 20px rgba(0, 255, 135, 0.3);
    animation: none;
    /* Stop floating when selected */
}

/* Absolute Layout simulating scatter */
.orb-vegan {
    width: 95px;
    height: 95px;
    top: 0%;
    left: 5%;
    font-size: 15px;
    animation-delay: 0s;
}

.orb-beauty {
    width: 85px;
    height: 85px;
    top: 8%;
    right: 8%;
    font-size: 14px;
    animation-delay: 0.5s;
}

.orb-pet {
    width: 105px;
    height: 105px;
    top: 30%;
    left: -2%;
    font-size: 16px;
    animation-delay: 1.2s;
}

.orb-food {
    width: 80px;
    height: 80px;
    top: 40%;
    right: 2%;
    font-size: 13px;
    animation-delay: 0.8s;
}

.orb-travel {
    width: 105px;
    height: 105px;
    bottom: 5%;
    left: 18%;
    font-size: 16px;
    animation-delay: 1.5s;
}

.orb-movie {
    width: 85px;
    height: 85px;
    bottom: 10%;
    right: 10%;
    font-size: 14px;
    animation-delay: 0.3s;
}

.orb-home {
    width: 90px;
    height: 90px;
    top: 25%;
    left: 33%;
    font-size: 14px;
    animation-delay: 1.0s;
}

.fixed-bottom-action {
    position: absolute;
    bottom: var(--safe-area-bottom);
    left: 0;
    width: 100%;
    padding: 0 24px 24px 24px;
    background: linear-gradient(to top, var(--bg-base) 70%, transparent);
    z-index: 50;
}

/* =========================================================
   1. Home (For You) View
   ========================================================= */

.home-main-title {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -1.2px;
    line-height: 1.35;
    margin-bottom: 24px;
}

.home-main-title .highlight {
    color: var(--primary-color);
}

/* Horizontal Article Slider */
.article-slider {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 12px;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
    cursor: grab;
}

.article-slider::-webkit-scrollbar {
    display: none;
}

.article-slider.dragging {
    cursor: grabbing;
}

.article-slider.dragging * {
    pointer-events: none;
    /* 드래그 중 내부 클릭 방지 */
}

.article-card-tall {
    flex: 0 0 260px;
    /* Fixed width for tall cards */
    height: 400px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    background-color: #EEE;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
}

@media (hover: hover) {
    .article-card-tall:hover {
        transform: scale(0.98);
    }
}

.article-card-tall:active {
    transform: scale(0.96);
}

.article-card-tall img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.article-card-overlay h3 {
    color: #FFF;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background-color: rgba(255, 255, 255, 0.95);
    margin-bottom: 12px;
    align-self: flex-start;
}

.badge .material-symbols-rounded {
    font-size: 14px;
}

.badge-travel {
    color: #007AFF;
}

.badge-beauty {
    color: var(--primary-color);
}


/* Product Ad Card */
.product-ad-card {
    position: relative;
    background: #1A1A1A;
    color: #FFF;
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s;
}

.product-ad-card:active {
    transform: scale(0.96);
}

.ad-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    color: #FFF;
}

.product-ad-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.product-ad-text {
    flex: 1;
}

.brand-name {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 4px;
}

.product-ad-text h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px;
    line-height: 1.4;
    color: #FFF;
}

.product-desc {
    font-size: 13px;
    color: #CCC;
    margin-bottom: 12px;
}

.product-price {
    font-size: 16px;
    font-weight: 800;
    color: #FFF;
}

.product-ad-img-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100px;
}

.product-ad-img-wrap img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
}

.btn-buy-now {
    background: var(--primary-color);
    color: #000;
    border: none;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 20px;
    width: 100%;
    cursor: pointer;
}

/* Active Draw Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 0;
}

.view-all {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-tertiary);
    text-decoration: none;
    font-weight: 500;
}

.view-all .material-symbols-rounded {
    font-size: 16px;
    margin-left: 2px;
}

.draw-card {
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
}

@media (hover: hover) {
    .draw-card:hover {
        transform: scale(0.98);
    }
}

.draw-card:active {
    transform: scale(0.96);
}

.draw-img-wrap {
    width: 140px;
    height: 100px;
    border-radius: 16px;
    background-color: #F8F9FB;
    /* Light subtle grey */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.draw-img-wrap img {
    height: 120%;
    /* Zoom in slightly for impact */
    object-fit: contain;
}

.draw-info {
    flex: 1;
}

.draw-status {
    font-size: 13px;
    font-weight: 600;
    color: #FF3B30;
    /* Fire Red */
    margin-bottom: 4px;
}

.draw-info h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 0;
}

/* =========================================================
   6. Touch Ripple Effect & Cursor Overrides
   ========================================================= */

.touch-ripple {
    position: fixed;
    width: 30px;
    height: 30px;
    background: rgba(0, 255, 135, 0.4);
    /* Primary color */
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    animation: rippleAnim 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    pointer-events: none;
    z-index: 9999;
}

@keyframes rippleAnim {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(5);
        opacity: 0;
    }
}

/* Optional: Make all primary elements give a pointer cursor for desktop testing */
.btn-primary,
.btn-outline-primary,
.taste-orb,
.nav-item {
    cursor: pointer;
}

/* =========================================================
   7. Toast Notification System
   ========================================================= */

.toast-container {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10000;
    pointer-events: none;
}

.toast-msg {
    background: rgba(30, 30, 30, 0.9);
    color: #FFF;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: toastFadeIn 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 1;
    transition: opacity 0.3s;
    text-align: center;
    white-space: nowrap;
}

.toast-msg.hiding {
    opacity: 0;
}

@keyframes toastFadeIn {
    0% {
        transform: translate(-50%, 20px);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* =========================================================
   9. Lucky Draw (럭키 드로우) Add-ons (Phase 9)
   ========================================================= */

.draw-live-ticker {
    display: inline-block;
    background: rgba(0, 255, 135, 0.1);
    color: #00A65A;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

#draw-live-count {
    font-weight: 900;
    font-size: 16px;
}

.draw-actions {
    display: flex;
    flex-direction: column;
    padding: 0 16px;
}

.draw-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    background: #F1F3F5;
    color: var(--text-secondary);
    padding: 16px;
    border-radius: var(--border-radius-lg);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.draw-share-btn:active {
    transform: scale(0.96);
    background: #E9ECEF;
}

.draw-share-btn .material-symbols-rounded {
    font-size: 20px;
    color: var(--text-tertiary);
}

/* =========================================================
   8. Record (기록) Tab UI (Main.png Design)
   ========================================================= */

.record-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    background: #FFFFFF;
    border-radius: var(--border-radius-lg);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
}

.record-mascot-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #EAFDF1;
    padding: 8px;
    object-fit: cover;
}

.record-hero-text h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.record-hero-text p {
    font-size: 14px;
    color: var(--text-tertiary);
}

.community-chips-section {
    width: 100%;
}

/* Marquee Animation */
.marquee-container {
    width: 100vw;
    /* Viewport width to bleed edge */
    margin-left: calc(-50vw + 50%);
    /* Center trick to break out of horizontal padding */
    overflow: hidden;
    position: relative;
    padding: 12px 0;
}

.marquee-track {
    display: inline-flex;
    gap: 12px;
    padding-left: 12px;
    width: max-content;
    animation: marquee 40s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

    /* JS renders double length, so translate 50% shifts perfectly */
}

/* Pause animation on hover for desktop testing */
.marquee-container:hover .marquee-track {
    animation-play-state: paused;
}

.record-chip {
    flex: 0 0 auto;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 12px 20px;
    font-size: 15px;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
}

.record-chip:active,
.btn-record-dontknow:active,
.btn-record-yes:active {
    transform: scale(0.96);
    box-shadow: none;
}

.record-chip strong {
    color: var(--text-primary);
    font-weight: 700;
    margin-right: 6px;
}

.record-action-section {
    text-align: center;
    padding: 12px 0;
}

.record-action-title {
    font-size: 26px;
    font-weight: 900;
    line-height: 1.35;
    color: var(--text-primary);
}

.record-buttons {
    display: flex;
    gap: 12px;
}

.btn-record-dontknow {
    flex: 1;
    padding: 20px 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    border-radius: var(--border-radius-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-record-yes {
    flex: 1.6;
    padding: 20px 0;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.4;
    border-radius: var(--border-radius-lg);
    background: linear-gradient(135deg, #4AFAB5, var(--primary-color));
    color: #000;
    position: relative;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 255, 135, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Floating speech bubble badge */
.bubble-badge {
    position: absolute;
    top: -24px;
    right: 12px;
    background: #000;
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 900;
    box-shadow: var(--shadow-md);
    animation: bubbleFloat 2.5s ease-in-out infinite;
    z-index: 10;
}

.bubble-badge::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #000;
}

@keyframes bubbleFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.record-footer-text {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* =========================================================
   10. In-App Detail Modal (Phase 9)
   ========================================================= */

.in-app-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-base);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.4, 1);
    display: none;
    /* Changed from visibility/flex to none */
    flex-direction: column;
}

.in-app-modal.active {
    transform: translateY(0);
}

.in-app-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 60px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.in-app-modal .modal-title {
    font-weight: 800;
    font-size: 16px;
}

.in-app-modal .material-symbols-rounded {
    cursor: pointer;
    font-size: 24px;
}

.in-app-modal .modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px 24px;
    background: #FFF;
}

.modal-dummy-img {
    width: 100%;
    border-radius: var(--border-radius-lg);
    margin-bottom: 24px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.modal-dummy-title {
    font-size: 24px;
    font-weight: 900;
    line-height: 1.4;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.modal-dummy-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* =========================================================
   Magazine Content Modal Styles
   ========================================================= */

.magazine-category {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.magazine-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.magazine-hero-img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: var(--border-radius-lg);
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

.magazine-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
    padding-bottom: 24px;
}

.magazine-lead {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.magazine-body h3 {
    margin-top: 32px;
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.magazine-body ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 32px;
}

.magazine-body li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 12px;
    line-height: 1.6;
}

.magazine-body li::before {
    content: "•";
    position: absolute;
    left: 4px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2em;
}

.magazine-body li strong {
    color: var(--text-primary);
}

.magazine-quote {
    background: #F8F9FA;
    border-left: 4px solid var(--primary-color);
    padding: 24px;
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.6;
    margin-top: 32px;
    font-style: italic;
}

/* =========================================================
   11. Mission Tab (Phase 10 Redesign)
   ========================================================= */

.mission-hero-banner {
    position: relative;
    width: 100%;
    height: 180px;
    border-radius: var(--border-radius-lg);
    background-image: url('assets/images/eco_action_bg.png');
    background-color: var(--primary-color);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    color: #FFF;
    box-shadow: var(--shadow-md);
    margin-top: 12px;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.mission-hero-banner .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 왼쪽을 어둡게 (텍스트 가독성 확보), 오른쪽은 투명하게 (인물 살림) */
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0) 100%);
    z-index: 1;
}

.mission-hero-banner .hero-text {
    position: relative;
    z-index: 2;
}

.mission-hero-banner .hero-sub {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.mission-hero-banner h2 {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.4;
    color: #FFF;
    margin: 0;
}

.mission-card {
    display: flex;
    align-items: center;
    background: #FFF;
    border-radius: var(--border-radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    gap: 16px;
    transition: transform 0.2s;
}

.mission-card:active {
    transform: scale(0.98);
}

.mission-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #EAFDF1;
    color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    flex-shrink: 0;
}

.mission-info {
    flex: 1;
}

.mission-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 0;
    color: var(--text-primary);
}

.mission-action-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 800;
    border-radius: 20px;
    background: #111;
    color: #FFF;
    border: none;
    cursor: pointer;
    min-width: 70px;
    transition: transform 0.2s, background-color 0.2s;
}

.mission-action-btn:active {
    transform: scale(0.95);
}

/* =========================================================
   12. Mobile Responsiveness Fixes (Phase 10)
   ========================================================= */

@media screen and (max-width: 480px) {
    body {
        background-color: var(--bg-base);
    }

    .presentation-wrapper {
        height: 100dvh;
        width: 100vw;
        display: block;
    }

    .device-frame {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
        overflow: hidden;
    }

    .bottom-nav {
        /* 하단 Safe Area 고려하여 뷰포트 바닥에 완전 밀착 */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        /* iOS Safari 등에서 짤리지 않게 env 적용 */
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }
}