/* ========================================
 * 로또 꿈해몽 - 서비스 전용 스타일
 * 보라/인디고 테마
 * ======================================== */

:root {
    --dream-primary: #7c3aed;
    --dream-primary-light: #a855f7;
    --dream-primary-bg: #f5f3ff;
    --dream-accent: #fbbf24;
    --dream-accent-dark: #f59e0b;
}

/* 페이지 배경 - 보라 그라데이션 */
body {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #e0e7ff 100%);
    min-height: 100vh;
}
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* 메인 컨테이너 z-index */
.hub-container { position: relative; z-index: 1; }

/* 히어로 보라 포인트 */
.dream-highlight { color: var(--dream-primary); }

/* ========================================
 * 글래스 카드
 * ======================================== */
.dream-glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
 * 검색 영역
 * ======================================== */
.dream-search-wrap {
    padding: 24px;
    margin-bottom: 24px;
}
.dream-search-row {
    display: flex;
    gap: 12px;
}
.dream-search-field {
    flex: 1;
    position: relative;
}
.dream-search-field i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px; height: 20px;
    color: #a78bfa;
}
.dream-search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e9d5ff;
    border-radius: 12px;
    font-size: 16px;
    background: #faf5ff;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}
.dream-search-input:focus {
    border-color: var(--dream-primary-light);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}
.dream-search-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.dream-search-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.dream-search-btn:hover::before { left: 100%; }
.dream-search-btn:hover {
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

/* 인기 검색어 */
.dream-popular {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.dream-popular-label {
    font-size: 14px;
    color: #6b7280;
}
.dream-keyword-tag {
    padding: 6px 14px;
    background: #f5f3ff;
    color: var(--dream-primary);
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.dream-keyword-tag:hover {
    background: #ede9fe;
}

/* ========================================
 * 검색 결과
 * ======================================== */
.dream-result-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.dream-result-count {
    color: #6b7280;
    font-size: 15px;
}
.dream-result-count strong {
    color: var(--dream-primary);
    font-weight: 600;
}
.dream-refine-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dream-refine-input {
    padding: 8px 32px 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    width: 160px;
    outline: none;
    box-sizing: border-box;
}
.dream-refine-input:focus { border-color: #a78bfa; }
.dream-refine-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.dream-refine-clear {
    font-size: 12px;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
}
.dream-refine-clear:hover { color: #6b7280; }

/* 꿈 카드 그리드 (2열) */
.dream-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.dream-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.dream-card:hover {
    transform: translateX(4px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.12);
    background: #faf5ff;
}
.dream-card-num {
    flex-shrink: 0;
    width: 32px; height: 32px;
    background: #f3e8ff;
    color: var(--dream-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
}
.dream-card-title {
    flex: 1;
    color: #1f2937;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dream-card:hover .dream-card-title { color: var(--dream-primary); }
.dream-card-arrow {
    flex-shrink: 0;
    width: 16px; height: 16px;
    color: #d1d5db;
}
.dream-card:hover .dream-card-arrow { color: var(--dream-primary-light); }

/* 초기 안내 */
.dream-empty {
    text-align: center;
    padding: 48px 0;
}
.dream-empty-icon {
    width: 80px; height: 80px;
    background: #f3e8ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}
.dream-empty-icon i { width: 40px; height: 40px; color: #a78bfa; }

/* 로딩 스피너 */
.dream-loading {
    text-align: center;
    padding: 16px;
    color: var(--dream-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ========================================
 * 행운 번호 (로또 볼)
 * ======================================== */
.dream-lucky-wrap {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-radius: 12px;
    padding: 24px;
}
.dream-lucky-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
.dream-lucky-num {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    font-weight: 700;
    width: 48px; height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* ========================================
 * 이용안내 / SEO 콘텐츠
 * ======================================== */
.dream-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dream-info-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    color: #4b5563;
    line-height: 1.6;
}
.dream-info-list li .dot {
    color: var(--dream-primary-light);
    margin-top: 2px;
    flex-shrink: 0;
}
.dream-seo-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.dream-seo-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
}
.dream-seo-card p {
    color: #4b5563;
    line-height: 1.7;
    margin: 0;
}

/* ========================================
 * FAQ 아코디언
 * ======================================== */
.dream-faq-item {
    border-bottom: 1px solid #e5e7eb;
}
.dream-faq-item:last-child { border-bottom: none; }
.dream-faq-q {
    width: 100%;
    padding: 18px 24px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    transition: background 0.2s;
}
.dream-faq-q:hover { background: #f9fafb; }
.dream-faq-arrow {
    width: 20px; height: 20px;
    color: #9ca3af;
    transition: transform 0.3s;
    flex-shrink: 0;
}
.dream-faq-arrow.open { transform: rotate(180deg); }
.dream-faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.dream-faq-a.show { max-height: 300px; }
.dream-faq-a-inner {
    padding: 0 24px 18px;
    color: #4b5563;
    line-height: 1.7;
}

/* ========================================
 * 개별 꿈 페이지 (dream.php)
 * ======================================== */
.dream-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--dream-primary);
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 15px;
}
.dream-back:hover { color: #6d28d9; }
.dream-badge {
    display: inline-block;
    padding: 4px 14px;
    background: #f3e8ff;
    color: #6d28d9;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.dream-keyword-label {
    color: #9ca3af;
    font-size: 14px;
}
.dream-interpret {
    font-size: 17px;
    line-height: 1.8;
    color: #374151;
}
.dream-extended {
    padding: 16px;
    background: #faf5ff;
    border-radius: 12px;
    margin-bottom: 24px;
}
.dream-extended h3 {
    font-size: 15px;
    font-weight: 600;
    color: #6d28d9;
    margin: 0 0 8px 0;
}
.dream-extended p {
    color: #4b5563;
    line-height: 1.7;
    margin: 0;
}
.dream-similar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s ease;
}
.dream-similar-link:hover {
    background: #faf5ff;
    transform: translateX(4px);
    color: var(--dream-primary);
}
.dream-cta-box {
    text-align: center;
    padding: 24px;
}
.dream-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--dream-primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}
.dream-cta-btn:hover { background: #6d28d9; }

/* ========================================
 * 섹션 제목
 * ======================================== */
.dream-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px 0;
}
.dream-section-title i {
    width: 20px; height: 20px;
    color: var(--dream-primary-light);
}

/* ========================================
 * 광고 블록
 * ======================================== */
.dream-ad-block {
    margin: 24px 0;
    text-align: center;
    min-height: 100px;
}

/* ========================================
 * 반응형
 * ======================================== */
@media (max-width: 640px) {
    .dream-search-row {
        flex-direction: column;
    }
    .dream-search-btn {
        justify-content: center;
    }
    .dream-grid {
        grid-template-columns: 1fr;
    }
    .dream-search-wrap {
        padding: 16px;
    }
    .dream-result-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Alpine.js cloak */
[x-cloak] { display: none !important; }
