

/* =====================================================
   1. 전역 & 기본 스타일 (Global & Reset)
===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #ff9ec7, #ffc9dd);
    min-height: 100vh;
}

hr {
    border: none;
    height: 1px;
    background-color: #eee;
    margin: 25px 0;
}

/* =====================================================
   2. 헤더, 로고, 내비게이션 (Header, Logo, Navigation)
===================================================== */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #ff9ec7;
    box-shadow: 0 4px 20px rgba(255, 158, 199, 0.3);
    position: sticky;
    top: 0;
    z-index: 900;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 32px;
    font-weight: bold;
    color: #e91e63;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-text {
    font-size: 36px;
    font-weight: 900;
    background: linear-gradient(45deg, #e91e63, #ff5722);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(233, 30, 99, 0.3);
}

.nav-menu {
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid #ffcdd2;
    padding: 0 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 40px;
    padding: 15px 0;
}

.nav-item a {
    color: #e91e63;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    padding: 10px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #e91e63, #ff5722);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-item a:hover {
    background: rgba(233, 30, 99, 0.1);
    color: #c2185b;
    transform: translateY(-2px);
}

.nav-item a:hover::before {
    width: 100%;
}

/* =====================================================
   3. 공통 컴포넌트 (Buttons, Auth)
===================================================== */
.auth-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-login {
    background: transparent;
    color: #e91e63;
    border: 2px solid #e91e63;
}

.btn-login:hover {
    background: #e91e63;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.3);
}

.btn-signup {
    background: linear-gradient(45deg, #e91e63, #ff5722);
    color: white;
}

.btn-signup:hover {
    background: linear-gradient(45deg, #c2185b, #e64a19);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
}

.btn-small {
    padding: 6px 14px;
    font-size: 14px;
    height: 40px;
    background: #e91e63;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-block;
    flex-shrink: 0;
}

/* =====================================================
   4. 모달 (공통)
===================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px; right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #e91e63;
}

.modal-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #e91e63;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #e91e63, #ff5722);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; color: #333; font-weight: 600; font-size: 14px; }
.form-input { width: 100%; padding: 15px; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 16px; transition: all 0.3s ease; background: #fafafa; }
.form-input:focus { outline: none; border-color: #e91e63; background: white; box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1); }
.form-btn { width: 100%; padding: 15px; background: linear-gradient(45deg, #e91e63, #ff5722); color: white; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 20px; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3); }
.form-btn:hover { background: linear-gradient(45deg, #c2185b, #e64a19); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4); }
.form-links { display: flex; justify-content: space-between; margin: 20px 0; }
.form-link { color: #e91e63; text-decoration: none; font-size: 14px; transition: color 0.3s ease; }
.form-link:hover { color: #c2185b; text-decoration: underline; }
.switch-link { text-align: center; padding-top: 20px; border-top: 1px solid #eee; margin-top: 20px; }
.switch-text { color: #666; font-size: 14px; }
.switch-btn { color: #e91e63; background: none; border: none; font-weight: 600; margin-left: 5px; transition: color 0.3s ease; cursor: pointer; font-size: 14px; }
.switch-btn:hover { color: #c2185b; text-decoration: underline; }

/* =====================================================
로고 가챠 머신 아이콘 (main.css에서 복사)
===================================================== */
.gacha-machine {
    width: 60px;
    height: 80px;
    position: relative;
    animation: bounce 2s infinite;
    margin-left: 10px; /* 로고 텍스트와의 간격 */
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.machine-top { width: 50px; height: 15px; background: linear-gradient(45deg, #1565c0, #0d47a1); border-radius: 10px 10px 5px 5px; border: 3px solid #0d47a1; position: relative; }
.machine-top::before { content: ''; position: absolute; top: 3px; left: 5px; width: 8px; height: 3px; background: #ffebee; border-radius: 2px; }
.machine-top::after { content: ''; position: absolute; top: 8px; left: 5px; width: 35px; height: 2px; background: #e53935; }
.machine-body { width: 50px; height: 40px; background: linear-gradient(45deg, #4dd0e1, #26c6da); border: 3px solid #0d47a1; border-radius: 5px; position: relative; margin-top: -2px; }
.machine-window { position: absolute; top: 5px; left: 8px; width: 30px; height: 25px; background: rgba(255, 255, 255, 0.9); border-radius: 3px; border: 2px solid #0d47a1; }
.machine-ball { position: absolute; top: 8px; left: 12px; width: 15px; height: 15px; background: linear-gradient(45deg, #ffd54f, #ffb300); border-radius: 50%; border: 2px solid #0d47a1; }
.machine-ball::after { content: ''; position: absolute; top: 6px; left: 0; width: 100%; height: 1px; background: #e53935; }
.machine-controls { width: 50px; height: 20px; background: linear-gradient(45deg, #e53935, #c62828); border: 3px solid #0d47a1; border-radius: 0 0 8px 8px; position: relative; margin-top: -2px; }
.control-button { position: absolute; top: 3px; left: 8px; width: 12px; height: 12px; background: #ffebee; border-radius: 50%; border: 2px solid #0d47a1; }
.control-knob { position: absolute; top: 5px; right: 8px; width: 8px; height: 8px; background: #90a4ae; border-radius: 50%; border: 2px solid #0d47a1; }

/* ===================================================== */

/* =====================================================
지도 페이지 (map.html) 전용 스타일
===================================================== */

/* 지도 페이지용 메인 콘텐츠 영역 (main.html과 구분) */
.main-content.map-page {
    position: relative;
    max-width: none; /* 너비 제한 해제 */
    margin: 30px auto;
}

/* 리셋 버튼 스타일 추가 */
.reset-button {
    position: absolute;  /* 부모(.main-content.map-page) 기준 위치 설정 */
    bottom: 20px;
    right: 20px;
    z-index: 500; /* 지도 컨트롤보다 위에 오도록 설정 */
    
    background: linear-gradient(45deg, #5a67d8, #8a5a9c);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    
    display: none; /* 평소에는 숨겨두고 검색 후에만 표시 */
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.reset-button i {
    margin-right: 8px;
}

/* 지도 페이지 검색창 CSS */
.map-search-container { 
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    overflow: hidden;
    background: #fafafa;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.map-search-container:focus-within {
    border-color: #e91e63;
    background: white;
    box-shadow: 0 4px 30px rgba(233, 30, 99, 0.2);
}

.map-search-input { 
    flex-grow: 1;
    padding: 15px 20px;
    padding-right: 60px;
    font-size: 16px;
    border: none;
    outline: none;
    background: transparent;
}

.map-search-input::placeholder { 
    color: #999; 
    font-weight: 500; 
}

.map-search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(45deg, #2196f3, #03a9f4);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    flex-shrink: 0;
}

.map-search-button:hover {
    background: linear-gradient(45deg, #1976d2, #0288d1); 
    transform: translateY(-50%) scale(1.05); 
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

/* 지도 페이지 (map.html) 전용 스타일 섹션에 추가 */
#map {
    width: 100%;
    height: 70vh;
    border-radius: 15px;
    background-color: #e0e0e0;
}

/* 지도 위 커스텀 팝업 */
.custom-popup-container { position: absolute; background: white; color: #333; padding: 20px; border-radius: 15px; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); width: 280px; transform: translate(-50%, -115%); display: none; border: 2px solid #e91e63; }
.custom-popup-container::after { content: ''; position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 12px solid #e91e63; }
.custom-popup-container h4 { color: #e91e63; font-size: 1.4rem; margin: 0 0 15px 0; padding-bottom: 10px; border-bottom: 1px solid #ffcdd2; }
.custom-popup-container p { margin: 8px 0; font-size: 0.9rem; }
.custom-popup-container img { width: 100%; border-radius: 10px; margin-bottom: 15px; border: 3px solid #000000;}
.details-button { display: block; width: 100%; text-align: center; margin-top: 15px; padding: 12px 24px; border: none; border-radius: 25px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-decoration: none; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); background: linear-gradient(45deg, #e91e63, #ff5722); color: white; }
.details-button:hover { background: linear-gradient(45deg, #c2185b, #e64a19); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4); }

/* 검색 결과 팝업 */
#search-popup { display: none; position: absolute; top: 150px; left: 40px; width: 350px; max-height: 400px; background-color: white; border-radius: 15px; box-shadow: 0 8px 25px rgba(0,0,0,0.2); z-index: 800; overflow: hidden; border: 1px solid #ddd; }
#search-popup-content { position: relative; padding: 20px; padding-top: 50px; }
#search-popup-content h3 { margin: 0; padding-bottom: 15px; border-bottom: 1px solid #eee; color: #333; }
#search-popup-close { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 24px; cursor: pointer; color: #999; }
#search-popup-close:hover { color: #333; }
#search-results-list { margin-top: 15px; max-height: 280px; overflow-y: auto; }
.search-result-item { padding: 12px 10px; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background-color 0.2s; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background-color: #f7f7f7; }

/* 가게 상세 정보 모달 */
.modal-header { display: flex; gap: 25px; margin-bottom: 25px; align-items: flex-start; flex-wrap: wrap; }
.modal-store-img { width: 220px; height: 220px; object-fit: cover; border-radius: 10px; flex-shrink: 0; border: 3px solid #000000; }
.modal-store-info { flex-grow: 1; min-width: 250px; }
.modal-store-info h2 { font-size: 2.2rem; margin: 0 0 10px 0; display: flex; align-items: center; gap: 15px; color: #333; }
.favorite-star { font-size: 2rem; cursor: pointer; color: #ccc; transition: all 0.2s; }
.favorite-star.active { color: #ffc107; transform: scale(1.2); }
.modal-store-info p { margin: 10px 0; color: #555; font-size: 1rem; }
.info-line { display: flex; align-items: center; gap: 12px; margin: 12px 0; color: #555; font-size: 1rem; }
.info-line i { font-size: 1.1rem; color: #e91e63; width: 20px; text-align: center; }
.like-count { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; margin-top: 15px; color: #e91e63; }
.like-count .fa-heart { font-size: 1.3rem; }
.modal h3 { color: #e91e63; margin-bottom: 20px; font-size: 1.8rem; }
.gacha-table-container { margin-top: 20px; }
.gacha-table { width: 100%; border-collapse: collapse; }
.gacha-table td { border: 1px solid #eee; padding: 12px; text-align: center; vertical-align: top; width: 25%; color: #333; }
.gacha-table img { width: 100%; max-width: 120px; border-radius: 8px; margin-bottom: 10px; border: 2px solid #f0f0f0; }

/* --- 상세 모달 내의 가챠 목록 --- */
.gacha-table-container {
    max-height: 45vh;
    overflow-y: auto;
    padding: 5px;
}

.gacha-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.gacha-table td {
    width: 25%;
    padding: 10px;
    vertical-align: top;
    border: 3px solid #e91e63;
}

.gacha-table img {
    width: 100%;
    max-width: 120px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 8px;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    border: 1px solid #eee;
}

.gacha-name {
    font-weight: bold;
    font-size: 14px;
    margin: 0 0 4px 0;
    line-height: 1.3;
    color: #333;
}

.gacha-stock {
    font-size: 12px;
    color: #007bff;
    font-weight: bold;
}

.gacha-stock.out-of-stock {
    color: #e74c3c;
}

/* --- 가챠 아이템 이미지 컨테이너 --- */
.gacha-img-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 8px auto;
    display: block;
}

/* --- 가챠 즐겨찾기 하트 아이콘 --- */
.favorite-gacha-heart {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 22px;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
}

.favorite-gacha-heart:hover {
    transform: scale(1.5);
}

.favorite-gacha-heart.active {
    color: #ff4d4d;
}

#loginModal .modal,

#signupModal .modal,

#findIdModal .modal,

#resetPwModal .modal {

    max-width: 400px;

    padding: 40px;

    max-height: none;

    overflow-y: visible;

}