/* ============================================================
   1. Root Variables & Reset
   ============================================================ */
   :root {
    --app-bg: #F8F9FA;
    --text-main: #1D1D1F;
    --text-sub: #86868B;
    --accent: #0A84FF; 
    --border-color: #F2F2F7;
    
    /* Dynamic Interaction Variables */
    --thumb-bg-color: #E5E5EA;
    --thumb-bg-image: none;
    --active-track-color: #E5E5EA;
}

body {
    font-family: 'Pretendard', 'Inter', sans-serif;
    background-color: var(--app-bg);
    color: var(--text-main);
    transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-font-smoothing: antialiased;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ============================================================
   2. Quadrant-Specific Expressions (SVG Data URIs)
   ============================================================ */

/* 0: Neutral (Center) */
body[data-quadrant="0"] {
    --thumb-bg-color: #E5E5EA;
    --thumb-bg-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0' /%3E%3Cpath d='M9 10l.01 0' /%3E%3Cpath d='M15 10l.01 0' /%3E%3C/svg%3E");
    --active-track-color: #D1D1D6;
}

/* 1: Angry (Red) */
body[data-quadrant="1"] {
    --thumb-bg-color: #F28B82;
    --thumb-bg-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M12 21a9 9 0 1 1 0 -18a9 9 0 0 1 0 18' /%3E%3Cpath d='M8 9l2 1' /%3E%3Cpath d='M16 9l-2 1' /%3E%3Cpath d='M14.5 16.05a3.5 3.5 0 0 0 -5 0' /%3E%3C/svg%3E");
    --active-track-color: #F28B82;
}

/* 2: Excited (Yellow) */
body[data-quadrant="2"] {
    --thumb-bg-color: #FDD663;
    --thumb-bg-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M12 21a9 9 0 1 1 0 -18a9 9 0 0 1 0 18' /%3E%3Cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0' /%3E%3Cpath d='M9 10h.01' /%3E%3Cpath d='M10 14v2a2 2 0 0 0 4 0v-2' /%3E%3Cpath d='M15.5 14h-7' /%3E%3Cpath d='M17 10c-.5 -1 -2.5 -1 -3 0' /%3E%3C/svg%3E");
    --active-track-color: #FDD663;
}

/* 3: Sad (Blue) */
body[data-quadrant="3"] {
    --thumb-bg-color: #8AB4F8;
    --thumb-bg-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0' /%3E%3Cpath d='M9 10l.01 0' /%3E%3Cpath d='M15 10l.01 0' /%3E%3Cpath d='M9.5 15.25a3.5 3.5 0 0 1 5 0' /%3E%3C/svg%3E");
    --active-track-color: #8AB4F8;
}

/* 4: Smile (Green) */
body[data-quadrant="4"] {
    --thumb-bg-color: #81C995;
    --thumb-bg-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0' /%3E%3Cpath d='M9 10l.01 0' /%3E%3Cpath d='M15 10l.01 0' /%3E%3Cpath d='M9.5 15a3.5 3.5 0 0 0 5 0' /%3E%3C/svg%3E");
    --active-track-color: #81C995;
}

/* ============================================================
   3. Main UI Layout (Grid & Pointer)
   ============================================================ */
.mood-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    aspect-ratio: 1 / 1;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    position: relative;
}

.cell { cursor: pointer; transition: transform 0.1s ease; }
.cell:hover { filter: brightness(1.05); transform: scale(1.05); z-index: 10; }

#mood-pointer {
    position: absolute;
    width: 36px;
    height: 36px;
    background-color: var(--thumb-bg-color);
    background-image: var(--thumb-bg-image);
    border: 3px solid #fff;
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 20;
    transform: translate(-50%, -50%);
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* ============================================================
   4. Slider Customization
   ============================================================ */
.slider-wrapper {
    position: relative;
    padding: 8px 0 24px 0;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #E5E5EA; 
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    margin-top: -15px; 
    border: 3px solid #fff;
    background-color: var(--thumb-bg-color);
    background-image: var(--thumb-bg-image);
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.2s ease;
}

input[type=range]::-moz-range-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border: 3px solid #fff;
    background-color: var(--thumb-bg-color);
    background-image: var(--thumb-bg-image);
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.2s ease;
}

/* Slider Scales & Typography */
.scale-container {
    position: relative;
    width: 100%;
    padding: 0 12px; 
    margin-top: 14px;
}
.scale-numbers, .label-row {
    display: flex;
    width: 100%;
    justify-content: space-between;
}
.scale-numbers span {
    width: 0;
    display: flex;
    justify-content: center;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 700;
    color: #D1D1D6;
}
.label-row { margin-bottom: 6px; }
.label-tag {
    font-size: 10px;
    font-weight: 900;
    color: #E2E2E7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 0;
    display: flex;
    justify-content: center;
    white-space: nowrap;
}
.slider-title {
    font-size: 13px;
    font-weight: 700;
    color: #C1C1C5;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}
.section-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-sub);
    margin-bottom: 12px;
    padding-left: 2px;
}

/* ============================================================
   5. Icon Buttons & Chips (수정: 반응형 줄바꿈 적용)
   ============================================================ */
.chips-container {
    display: flex;
    flex-wrap: wrap; /* 가로 스크롤 대신 줄바꿈 적용 */
    justify-content: center; /* 모바일에서 칩들을 중앙 정렬 */
    gap: 16px 12px; /* 상하 16px, 좌우 12px 간격 */
    padding: 8px 2px;
    scroll-behavior: smooth;
}
.icon-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 72px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}
.icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1.5px solid #E5E5EA;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3A3A3C;
    transition: all 0.2s ease;
}
.icon-btn-wrapper.active .icon-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 6px 12px rgba(10, 132, 255, 0.2);
}
.icon-label {
    width: 100%;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-sub);
    text-align: center;
    line-height: 1.2;
    white-space: normal;
    word-break: keep-all; 
    overflow-wrap: break-word;
    padding: 0 2px;
}

/* ============================================================
   6. Modals & Overlay
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-content {
    background: white;
    width: 100%;
    max-width: 480px;
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    max-height: 85vh;
    overflow-y: auto;
}

/* ============================================================
   7. Footer & Navigation
   ============================================================ */
footer {
    margin-top: 40px;
    padding-bottom: 40px;
    text-align: center;
    border-top: 1px solid #F2F2F7;
    padding-top: 20px;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 11px;
    color: var(--text-sub);
}
.footer-link {
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}
.footer-link:hover { color: var(--text-main); }
.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.2s;
}
.nav-group:hover .nav-icon {
    transform: scale(1.1);
    background: #F2F2F7;
    color: var(--accent);
}
.nav-group:hover #ui-guide-label { color: var(--accent); }