/*
 * Stylesheet for the QuestEat PWA
 *
 * This file defines a sleek, modern look tailored for the MZ 세대 (Millennials/Z) and content creators.
 * It leverages trendy gradients reminiscent of Instagram/TikTok branding, while keeping legibility and usability
 * at the forefront. All layout layers float above the full‑screen Kakao map background.
 */

/* Reset & base styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', 'Montserrat', sans-serif;
    background: #fafafa;
    overflow: hidden;
    color: #333;
}

/* Map occupies the full viewport and sits at the lowest z-index */
#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* Search bar container */
.search-container {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 600px;
    z-index: 3;
}

/* Search wrapper for input and button */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
}

.search-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.95);
}

/* Search input box */
.search-input {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    border-radius: 2rem 0 0 2rem;
}

.search-input::placeholder {
    color: #777;
}

/* Search button */
.search-button {
    padding: 0.75rem 1rem;
    border: none;
    background: linear-gradient(45deg, #4f5bd5, #962fbf);
    color: white;
    border-radius: 0 2rem 2rem 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    min-width: 50px;
}

.search-button:hover {
    background: linear-gradient(45deg, #3a4bc7, #7a25a3);
    transform: scale(1.05);
}

.search-button:active {
    transform: scale(0.95);
}

.search-button svg {
    width: 20px;
    height: 20px;
}

/* 자동완성 드롭다운 */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
}

.search-dropdown.hidden {
    display: none;
}

.search-suggestions {
    padding: 0.5rem 0;
}

.suggestion-item {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: rgba(79, 91, 213, 0.1);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.suggestion-address {
    font-size: 0.875rem;
    color: #666;
}

.suggestion-category {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

.priority-label {
    display: inline-block;
    background: linear-gradient(45deg, #feda75, #fa7e1e);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    margin-left: 0.5rem;
    font-weight: 600;
}

/* AI Quest button — uses a vibrant animated gradient and a soft drop shadow */
.ai-quest-button {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 3;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background-image: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5);
    background-size: 300% 300%;
    animation: gradientMove 5s linear infinite;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    transition: transform 0.15s ease;
}

.ai-quest-button:hover {
    transform: scale(1.05);
}

.ai-quest-button span {
    white-space: nowrap;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Mini bio overlay that animates from the bottom */
.mini-bio {
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    width: 80%;
    max-height: 65%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.35s ease;
    z-index: 4;
    overflow-y: auto;
    padding: 1.25rem;
}

.mini-bio.show {
    transform: translateY(0);
}

.mini-bio-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.mini-bio-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #555;
}

/* 새로운 body 레이아웃 */
.mini-bio-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: calc(100% - 2rem);
}

/* 상단 이미지 영역 (모바일용) */
.mini-bio-image-top {
    width: 100%;
    display: none; /* 기본적으로 숨김 */
    justify-content: center;
    align-items: center;
}

.mini-bio-image-top img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    max-height: 150px;
}

.mini-bio-content {
    flex: 1;
    overflow-y: auto;
}

/* 우측 이미지 영역 (PC용) */
.mini-bio-image {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-bio-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* PC에서는 flex-direction을 row로 변경 */
@media (min-width: 769px) {
    .mini-bio-body {
        flex-direction: row;
    }
    
    .mini-bio-image-top {
        display: none; /* PC에서는 상단 이미지 숨김 */
    }
}

/* 모바일에서는 상단 이미지 표시, 우측 이미지 숨김 */
@media (max-width: 768px) {
    .mini-bio-body {
        flex-direction: column;
    }
    
    .mini-bio-image-top {
        display: flex; /* 모바일에서는 상단 이미지 표시 */
    }
    
    .mini-bio-image {
        display: none; /* 모바일에서는 우측 이미지 숨김 */
    }
    
    .mini-bio-content {
        flex: none;
    }
}

/* Utility class to hide elements until they are shown */
.hidden {
    display: none;
}

/* 전광판 뉴스 티커 */
.news-ticker {
    margin-top: 0.5rem;
    background: linear-gradient(45deg, #1a1a1a, #2d2d2d);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    height: 40px;
    display: flex;
    align-items: center;
    position: relative;
}

.ticker-content {
    display: flex;
    animation: scroll-left 10s linear infinite;
    white-space: nowrap;
    will-change: transform;
    align-items: center;
    height: 100%;
}

/* 기본 메시지 스타일 */
.ticker-default {
    color: #ffd700;
    font-size: 0.85rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    padding: 0 1rem;
}

/* 뉴스 아이템 스타일 */
.ticker-item {
    display: inline-flex;
    align-items: center;
    margin-right: 4rem;
    color: #ffffff;
    white-space: nowrap;
    height: 100%;
}

.ticker-title {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-right: 0.5rem;
}

.ticker-subtitle {
    color: #ffd700;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255, 215, 0, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .news-ticker {
        height: 35px;
    }
    
    .ticker-title {
        font-size: 0.75rem;
    }
    
    .ticker-subtitle {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
    
    .ticker-item {
        margin-right: 2rem;
    }
}

@media (max-width: 480px) {
    .news-ticker {
        height: 30px;
    }
    
    .ticker-title {
        font-size: 0.7rem;
    }
    
    .ticker-subtitle {
        font-size: 0.65rem;
        padding: 0.1rem 0.3rem;
    }
    
    .ticker-item {
        margin-right: 1.5rem;
    }
}

@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* 배너 컨테이너 */
.banner-container {
    position: fixed;
    z-index: 2;
    pointer-events: none; /* 지도 조작을 방해하지 않도록 */
}

/* 배너 이미지 */
.banner-image {
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.banner-image:hover {
    transform: scale(1.05);
}

/* PC 스타일 - 왼쪽 중앙에 250px */
@media (min-width: 769px) {
    .banner-container {
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .banner-image {
        width: 250px;
        height: auto;
    }
}

/* 스마트폰 스타일 - 좌측 하단에 100px */
@media (max-width: 768px) {
    .banner-container {
        left: 15px;
        bottom: 20px;
    }
    
    .banner-image {
        width: 100px;
        height: auto;
    }
}