/* ====================================
   꿈 해몽 사전 스타일
   메인 색상: #DEB564 (골드)
==================================== */

/* 색상 변수 오버라이드 */
:root {
    --dream-gold: #DEB564;
    --dream-gold-light: #F5D998;
    --dream-gold-dark: #B8943F;
    --dream-purple: #6a4c93;
    --dream-purple-light: #c77dff;
}

/* ====================================
   검색 섹션
==================================== */
.dream-search-section {
    background: var(--light-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    animation: fadeIn 0.8s ease;
}

.search-container {
    max-width: 700px;
    margin: 0 auto 30px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 3px solid var(--dream-gold);
    border-radius: 50px;
    padding: 5px 20px;
    box-shadow: 0 4px 15px rgba(222, 181, 100, 0.2);
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--dream-gold-dark);
    box-shadow: 0 6px 25px rgba(222, 181, 100, 0.3);
}

.search-icon {
    font-size: 1.4rem;
    margin-right: 15px;
    color: var(--dream-gold);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    padding: 15px 0;
    background: transparent;
    color: var(--text-dark);
}

.search-input::placeholder {
    color: #999;
}

.search-clear {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 5px 10px;
    transition: var(--transition);
}

.search-clear:hover {
    color: var(--dream-gold-dark);
    transform: scale(1.1);
}

/* 검색 힌트 */
.search-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.search-hint span {
    color: #777;
    font-size: 0.9rem;
}

.hint-tag {
    background: linear-gradient(135deg, var(--dream-gold-light), var(--dream-gold));
    color: var(--text-dark);
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.hint-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(222, 181, 100, 0.4);
}

/* ====================================
   카테고리 필터
==================================== */
.category-filter {
    margin-top: 30px;
}

.filter-title {
    text-align: center;
    color: var(--dream-purple);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 2px solid #e0e0e0;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-dark);
}

.category-btn:hover {
    border-color: var(--dream-gold);
    background: rgba(222, 181, 100, 0.1);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--dream-gold), var(--dream-gold-dark));
    border-color: var(--dream-gold);
    color: white;
    box-shadow: 0 4px 12px rgba(222, 181, 100, 0.4);
}

.cat-icon {
    font-size: 1.1rem;
}

/* ====================================
   결과 섹션
==================================== */
.dream-results-section {
    background: var(--light-bg);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    animation: fadeIn 1s ease;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--dream-gold);
}

.results-title {
    color: var(--dream-purple);
    font-size: 1.5rem;
}

.results-count {
    color: var(--dream-gold-dark);
    font-weight: 600;
    background: rgba(222, 181, 100, 0.2);
    padding: 6px 15px;
    border-radius: 20px;
}

/* ====================================
   꿈 카드 리스트
==================================== */
.dream-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.dream-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: var(--transition);
    animation: fadeInUp 0.5s ease backwards;
    border: 2px solid transparent;
}

.dream-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(222, 181, 100, 0.25);
    border-color: var(--dream-gold);
}

.dream-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.dream-emoji {
    font-size: 3rem;
    line-height: 1;
}

.dream-category-badge {
    background: linear-gradient(135deg, var(--dream-gold-light), var(--dream-gold));
    color: var(--text-dark);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.dream-title {
    color: var(--dream-purple);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.dream-keyword {
    color: var(--dream-gold-dark);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.dream-summary {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.dream-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.dream-tag {
    background: rgba(222, 181, 100, 0.2);
    color: var(--dream-gold-dark);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.dream-detail-btn {
    width: 100%;
    background: transparent;
    border: 2px solid var(--dream-gold);
    color: var(--dream-gold-dark);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.dream-detail-btn:hover {
    background: var(--dream-gold);
    color: white;
}

/* ====================================
   페이지네이션
==================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-btn {
    background: white;
    border: 2px solid #e0e0e0;
    color: var(--text-dark);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover:not(.disabled):not(.active) {
    border-color: var(--dream-gold);
    color: var(--dream-gold-dark);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--dream-gold), var(--dream-gold-dark));
    border-color: var(--dream-gold);
    color: white;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-dots {
    color: #999;
    padding: 0 5px;
}

/* ====================================
   결과 없음
==================================== */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h3 {
    color: var(--dream-purple);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.no-results p {
    color: #777;
}

/* ====================================
   모달
==================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-overlay.hidden {
    display: none;
}

.dream-modal {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: linear-gradient(135deg, var(--dream-gold-light), var(--dream-gold));
    border-radius: 20px 20px 0 0;
}

.modal-emoji {
    font-size: 4rem;
    line-height: 1;
}

.modal-title-area {
    flex: 1;
}

.modal-title {
    color: var(--text-dark);
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.modal-category {
    color: rgba(0, 0, 0, 0.7);
    font-size: 1rem;
    font-weight: 500;
}

.modal-body {
    padding: 30px;
}

.modal-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section.positive-section {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border-left: 4px solid #22c55e;
}

.modal-section.negative-section {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border-left: 4px solid #ef4444;
}

.section-title {
    color: var(--dream-purple);
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.section-content {
    color: #555;
    line-height: 1.8;
    font-size: 1rem;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-tag {
    background: linear-gradient(135deg, var(--dream-gold-light), var(--dream-gold));
    color: var(--text-dark);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.modal-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-radius: 0 0 20px 20px;
    text-align: center;
}

.modal-disclaimer {
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
}

/* ====================================
   확장 데이터 스타일
==================================== */

/* 꿈 유형 배지 */
.dream-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(0,0,0,0.2);
    color: rgba(255,255,255,0.9);
    margin-left: 10px;
}

.dream-type-badge.good {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

/* 심볼 섹션 */
.symbols-section {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(168, 85, 247, 0.05)) !important;
    border-left: 4px solid #8b5cf6 !important;
}

.modal-symbols {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.symbol-badge {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 감정 섹션 */
.emotions-section {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05)) !important;
    border-left: 4px solid #3b82f6 !important;
}

.modal-emotions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.emotion-badge {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 심리학적 해석 섹션 */
.psychology-section {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(219, 39, 119, 0.05)) !important;
    border-left: 4px solid #ec4899 !important;
}

/* 문화적 배경 섹션 */
.culture-section {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.05)) !important;
    border-left: 4px solid #f59e0b !important;
}

/* 연관 꿈 섹션 */
.related-section {
    background: linear-gradient(135deg, rgba(222, 181, 100, 0.15), rgba(222, 181, 100, 0.05)) !important;
    border-left: 4px solid var(--dream-gold) !important;
}

.related-dreams {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.related-dream-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 10px 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid var(--dream-gold-light);
}

.related-dream-item:hover {
    background: var(--dream-gold);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(222, 181, 100, 0.3);
}

.related-emoji {
    font-size: 1.2rem;
}

.related-title {
    font-size: 0.9rem;
    font-weight: 500;
}

/* 태그 클릭 가능 스타일 */
.modal-tag {
    cursor: pointer;
    transition: var(--transition);
}

.modal-tag:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(222, 181, 100, 0.4);
}

/* 확장 데이터 빈도 표시 */
.frequency-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 8px;
}

.frequency-badge.very-high {
    background: #ef4444;
    color: white;
}

.frequency-badge.high {
    background: #f59e0b;
    color: white;
}

.frequency-badge.medium {
    background: #3b82f6;
    color: white;
}

.frequency-badge.low {
    background: #6b7280;
    color: white;
}

/* ====================================
   에러 메시지
==================================== */
.error-message {
    text-align: center;
    padding: 40px;
    color: #ef4444;
    font-size: 1.1rem;
}

/* ====================================
   반응형 디자인
==================================== */
@media (max-width: 768px) {
    .dream-search-section,
    .dream-results-section {
        padding: 25px 20px;
    }

    .search-box {
        padding: 5px 15px;
    }

    .search-input {
        font-size: 1rem;
        padding: 12px 0;
    }

    .category-buttons {
        gap: 8px;
    }

    .category-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .dream-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .modal-header {
        flex-direction: column;
        text-align: center;
        padding: 25px;
    }

    .modal-emoji {
        font-size: 3rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 20px;
    }

    .pagination {
        gap: 5px;
    }

    .page-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .search-hint {
        flex-direction: column;
        gap: 8px;
    }

    .search-hint span {
        margin-bottom: 5px;
    }

    .hint-tag {
        font-size: 0.8rem;
        padding: 5px 12px;
    }

    .category-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .cat-icon {
        font-size: 1rem;
    }

    .dream-card {
        padding: 20px;
    }

    .dream-emoji {
        font-size: 2.5rem;
    }

    .dream-title {
        font-size: 1.1rem;
    }

    .dream-modal {
        max-height: 90vh;
        border-radius: 15px;
    }

    .modal-header {
        border-radius: 15px 15px 0 0;
    }

    .modal-footer {
        border-radius: 0 0 15px 15px;
    }
}

/* ====================================
   애니메이션
==================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 스크롤바 스타일 */
.dream-modal::-webkit-scrollbar {
    width: 8px;
}

.dream-modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.dream-modal::-webkit-scrollbar-thumb {
    background: var(--dream-gold);
    border-radius: 10px;
}

.dream-modal::-webkit-scrollbar-thumb:hover {
    background: var(--dream-gold-dark);
}

