/* ============================================================
   CSS 변수
   ============================================================ */
:root {
    --bg-color: #ffffff;
    --line-color: #F0F2F5;
    --primary-color: #FF8BA0;
    --saju-color: #4A148C;
    --saju-grad-start: #311B92;
    --saju-grad-end: #7B1FA2;
    --accent-gold: #D4AF37;
    --saju-light: #F3E5F5;
    --text-main: #333333;
}

/* ============================================================
   기본 레이아웃
   ============================================================ */
body {
    background-color: #F8F9FA;
}

#app {
    background-color: #ffffff;
    box-shadow: var(--shadow-app);
}

/* ============================================================
   섹션 공통
   ============================================================ */
.list-section {
    padding: 24px 16px;
}

.list-section--ad-bottom {
    padding-top: 0;
    padding-bottom: 100px;
}

.section-divider {
    height: 3px;
    background-color: var(--line-color);
    width: 100%;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.section-icon {
    font-size: 20px;
}

.section-title {
    font-size: 19px;
    font-weight: 800;
    color: #111;
    letter-spacing: -0.5px;
}

/* ============================================================
   광고 배너
   ============================================================ */
.ad-banner-wrapper {
    width: 100%;
    display: block;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 10px;
}

.ad-banner-wrapper img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.ad-badge-left {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: var(--radius-xs);
    z-index: 10;
    letter-spacing: 0.5px;
}

/* ============================================================
   사주 카드
   ============================================================ */
.saju-single-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--saju-light);
    border: 1px solid rgba(74, 20, 140, 0.2);
    border-radius: var(--radius-lg);
    padding: 12px;
    text-decoration: none;
    transition: transform var(--transition-fast);
    box-shadow: 0 4px 10px rgba(49, 27, 146, 0.05);
}

.saju-single-card:hover {
    transform: translateY(-2px);
}

.saju-thumb {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.saju-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.saju-badge {
    align-self: flex-start;
    background: var(--saju-color);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: var(--radius-xs);
    margin-bottom: 6px;
}

.saju-title {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin: 0 0 6px 0;
    line-height: 1.3;
    word-break: keep-all;
}

.saju-count {
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-star {
    width: 12px;
    height: 12px;
    fill: var(--saju-grad-end);
}

/* ============================================================
   심리 테스트 그리드
   ============================================================ */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 10px;
}

.test-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform var(--transition-fast);
}

.test-card:hover {
    transform: none;
}

.test-thumb-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 8px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
}

.test-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-fast) ease-in-out;
}

.test-card:hover .test-thumb {
    transform: scale(1.08);
}

.category-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background-color: var(--primary-color);
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    z-index: 10;
}

.test-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    height: 34px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #333;
    word-break: keep-all;
}

.test-count {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 500;
}

.icon-view {
    width: 12px;
    height: 12px;
    stroke: #aaa;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================================
   이미지 슬라이더
   ============================================================ */
.info-slider-wrapper {
    position: relative;
    background: #ffffff;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line-color);
}

.info-slider-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.info-slider-track {
    display: flex;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-item {
    flex: 0 0 100%;
    width: 100%;
    display: block;
    position: relative;
    text-decoration: none;
    background-color: #f1f3f5;
    -webkit-user-drag: none;
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
    pointer-events: none;
}

.slider-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
}

.indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: width var(--transition-base) ease;
    cursor: pointer;
}

.indicator.active {
    width: 40px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.05);
}

.indicator-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.05) 100%
    ), var(--primary-color);
    border-radius: 5px;
    box-shadow: 0 0 8px var(--primary-color);
    overflow: hidden;
}

.indicator-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    animation: gaugeShine 2s infinite;
}

/* ============================================================
   플로팅 버튼
   ============================================================ */
.floating-btn {
    position: fixed;
    bottom: 24px;
    right: calc(50% - 220px);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-family: 'Jua', sans-serif;
    animation: floatUpDown 2.5s infinite ease-in-out;
    filter: drop-shadow(0 0 8px rgba(249, 217, 73, 0.3));
}

/* 퍼플 유리구슬 본체 */
.floating-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(135deg,
        #8B5CF6 0%,
        #6D28D9 50%,
        #4C1D95 100%
    );
    box-shadow:
        inset 0 12px 16px -8px rgba(255, 255, 255, 0.9),
        inset 0 -8px 12px -4px rgba(0, 0, 0, 0.4),
        inset 0 0 10px rgba(255, 255, 255, 0.2),
        0 10px 20px rgba(76, 29, 149, 0.3);
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(2px);
}

/* 노란색 아우라 (반시계 회전) */
.floating-btn::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        rgba(249, 217, 73, 0.05) 30%,
        rgba(249, 217, 73, 0.5) 85%,
        transparent 100%
    );
    filter: blur(10px);
    z-index: 1;
    animation: spinTornado 2s linear infinite reverse;
}

.floating-btn .float-icon {
    font-size: 26px;
    line-height: 1;
    position: relative;
    z-index: 3;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.floating-btn .float-text {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.9;
    position: relative;
    z-index: 3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   풀스크린 로딩 오버레이
   ============================================================ */
.full-screen-event {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 5, 29, 0.95);
    z-index: var(--z-loading);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s;
    backdrop-filter: blur(5px);
}

.full-screen-event.active {
    opacity: 1;
    visibility: visible;
}

.elegant-spinner {
    width: 70px;
    height: 70px;
    margin-bottom: 24px;
    border: 3px solid rgba(212, 175, 55, 0.15);
    border-top: 3px solid var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.event-text {
    font-family: 'Pretendard', sans-serif;
    color: #f5f5f5;
    font-size: 17px;
    font-weight: 500;
    margin-top: 10px;
    animation: pulse 1.5s infinite alternate;
    letter-spacing: 0.5px;
}

/* ============================================================
   바텀시트 모달
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: var(--z-overlay);
    display: none;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal-overlay.active {
    display: block;
    opacity: 1;
}

.modal-content {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 30px 20px 40px;
    box-sizing: border-box;
    z-index: var(--z-modal);
    transition: bottom 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.5s ease;
    height: auto;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-content.active {
    bottom: 0;
}

.modal-content.expanded {
    max-height: 90vh;
    height: 90vh;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    z-index: 10;
}

.modal-title {
    font-family: 'Jua', sans-serif;
    font-size: 24px;
    color: var(--saju-color);
    margin: 0 0 8px 0;
}

.modal-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    word-break: keep-all;
}

.input-row {
    display: grid;
    grid-template-columns: 3.5fr 6.5fr;
    gap: 10px;
    margin-bottom: 16px;
    width: 100%;
}

.modal-input {
    width: 100%;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-size: 15px;
    box-sizing: border-box;
    outline: none;
    background: #fafafa;
    transition: border-color var(--transition-fast);
}

.modal-input:focus {
    border-color: var(--saju-color);
    background: #fff;
}

.modal-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--saju-grad-start) 0%, var(--saju-grad-end) 100%);
    color: #fff;
    padding: var(--btn-padding);
    border: none;
    border-radius: var(--btn-radius);
    font-size: var(--btn-font-size-lg);
    font-family: 'Jua', sans-serif;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(49, 27, 146, 0.3);
    transition: transform var(--transition-fast);
}

.modal-submit:active {
    transform: scale(0.98);
}

.modal-btn-close-bottom {
    width: 100%;
    padding: var(--btn-padding);
    border: 1px solid #ddd;
    border-radius: var(--btn-radius);
    background: #fff;
    color: #333;
    font-size: var(--btn-font-size);
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: background var(--transition-fast);
    font-family: 'Pretendard', sans-serif;
}

.modal-btn-close-bottom:hover {
    background: #f5f5f5;
}

/* ============================================================
   운세 결과
   ============================================================ */
.quick-result-box {
    display: none;
    margin-top: 10px;
    text-align: left;
    animation: fadeIn 0.5s ease;
}

.result-header {
    text-align: center;
    margin-bottom: 24px;
}

.quick-result-title {
    font-family: 'Jua', sans-serif;
    font-size: 26px;
    color: var(--saju-color);
    margin: 0 0 8px 0;
    font-weight: bold;
}

.quick-result-score {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent-gold);
    background: #FFF9C4;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    display: inline-block;
    border: 1px solid var(--accent-gold);
}

.quick-result-text {
    font-size: 15px;
    color: #333;
    line-height: 1.8;
    word-break: keep-all;
    margin: 0 0 24px 0;
    background: var(--saju-light);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(74, 20, 140, 0.1);
}

.advice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.advice-card {
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
}

.advice-good {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.advice-bad {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

.advice-title {
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
    opacity: 0.8;
}

/* 한줄평 전용 명조체 */
.master-advice {
    background: #FFFDE7;
    border: 1px dashed #FBC02D;
    padding: 20px 16px;
    border-radius: var(--radius-md);
    font-family: 'Gowun Batang', serif;
    font-size: 18px;
    color: #F57F17;
    text-align: center;
    font-weight: bold;
    line-height: 1.5;
}

/* ============================================================
   애니메이션
   ============================================================ */
@keyframes floatUpDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes spinTornado {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    from { opacity: 0.6; }
    to { opacity: 1; text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
}

@keyframes gaugeShine {
    0% { left: -100%; }
    50%, 100% { left: 150%; }
}

/* ============================================================
   반응형
   ============================================================ */
@media (max-width: 480px) {
    .floating-btn {
        right: 20px;
    }
}
