/* Franchise Location Search Styles */
.franchise-search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Search Form Styles */
.search-form {
    margin-bottom: 30px;
}

.search-input-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.location-search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.location-search-input:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-icon img {
    width: 20px;
    height: 20px;
    opacity: 0.6;
}

.search-input-container.focused .search-icon img {
    opacity: 1;
}

/* Background Container */
.background_back {
    
    padding: 20px;
    border-radius: 10px;
    min-height: 200px;
}

/* Results Container */
.location-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 0;
}

/* Location Item Card - 이미지 참고한 새로운 디자인 */
.location-item {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e8eaed;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.location-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Location Image - 상단 큰 이미지 영역 */
.location-image {
    width: 100%;
    height: 200px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: #d6dae3; /* 이미지 로딩 전 기본 배경 */
}

.location-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
    display: block;
}

.location-item:hover .location-image img {
    transform: scale(1.05);
}

.location-image-placeholder {
    width: 100%;
    height: 100%;
    background: #d6dae3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #a0a8b1;
    position: relative;
}

.location-image-placeholder::before {
    content: "🏪";
    font-size: 40px;
    opacity: 0.6;
    margin-bottom: 8px;
}

.location-image-placeholder::after {
    content: "이미지 없음";
    font-size: 12px;
    opacity: 0.8;
}

/* Location Info - 하단 흰색 정보 영역 */
.location-info {
    padding: 25px 20px 20px;
    background: white;
}

.location-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
    text-align: center;
    line-height: 1.3;
}

.location-address {
    color: #666;
    font-size: 13px;
    margin: 0 0 20px 0;
    line-height: 1.4;
    text-align: center;
}

/* 블로그 버튼 - 중앙의 주황색 버튼 */
.location-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.location-btn {
    padding: 5px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
.map-btn {
    background: #3194FF;
    color: white;
    min-width: 100px;
    display:flex; align-items:center; justify-content: space-between; gap:3px
}

.map-btn:hover {
    background: #3194FF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}
.blog-btn img{margin-bottom:0px!important;}
.blog-btn {
    background: #3194FF;
    color: white;
    min-width: 100px;  display:flex; align-items:center; justify-content: space-between; gap:3px; width: 50%;
}

.blog-btn:hover {
    background: #3194FF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}

/* Contact Buttons - 하단 전화번호와 지도보기 */
.location-contact {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.contact-btn {
    flex: 1;
    padding: 12px 15px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #e8eaed;
    color: #666;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.contact-btn:hover {
    border-color: #3194FF;
    background: #3194FF;
    transform: translateY(-1px);
}

.phone-btn {
    color: #333;
}

.phone-btn:hover {
    border-color: #3194FF;
    background: #fff;
    color: #3194FF;
}

.map-btn {
    color: #333;
}

.map-btn:hover {
    border-color: #2196f3;
    background: #e3f2fd;
    color: #1565c0;
}

.contact-icon {
    font-size: 14px;
}

/* Loading State */
.location-results.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.location-results.loading::after {
    content: "검색 중...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    color: #666;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    grid-column: 1 / -1;
}

.no-results p {
    font-size: 16px;
    margin: 0;
}

.no-results::before {
    content: "🔍";
    font-size: 48px;
    display: block;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #f44336;
    grid-column: 1 / -1;
}

.error-message p {
    font-size: 16px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .franchise-search-container {
        padding: 15px;
    }
    
    .location-results {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .location-item {
        margin: 0 auto;
        max-width: 100%;
    }
    
    .location-image {
        height: 180px;
    }
    
    .location-info {
        padding: 20px 15px 15px;
    }
    
    .location-title {
        font-size: 16px;
    }
    
    .location-address {
        font-size: 12px;
    }
    
    .contact-btn {
        font-size: 12px;
        padding: 10px 12px;
    }
    
    .search-input-container {
        margin: 0;
    }
    
    .location-search-input {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .location-contact {
        gap: 8px;
    }
    
    .contact-btn {
        justify-content: center;
        font-size: 11px;
    }
    
    .background_back {
        padding: 15px;
    }
    
    .location-item {
        max-width: 280px;
    }
}

/* Animation for new items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.location-item {
    animation: fadeInUp 0.3s ease forwards;
}

/* Focus styles for accessibility */
.location-btn:focus,
.contact-btn:focus {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

.location-search-input:focus {
    outline: none;
}

/* Image Popup Modal */
.image-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.image-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-popup-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.image-popup-overlay.active .image-popup-container {
    transform: scale(1);
}

.image-popup-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    max-width: 80vw;
    max-height: 80vh;
}

.image-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.image-popup-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.image-popup-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 30px 20px 20px;
    text-align: center;
}

.image-popup-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.image-popup-address {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

/* Mobile popup adjustments */
@media (max-width: 768px) {
    .image-popup-container {
        max-width: 95vw;
        max-height: 95vh;
        margin: 20px;
    }
    
    .image-popup-image {
        max-width: 90vw;
        max-height: 85vh;
    }
    
    .image-popup-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .image-popup-info {
        padding: 20px 15px 15px;
    }
    
    .image-popup-title {
        font-size: 16px;
    }
    
    .image-popup-address {
        font-size: 13px;
    }
}

/* Loading animation for popup image */
.image-popup-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 16px;
}

.image-popup-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Body scroll lock when popup is open */
body.popup-open {
    overflow: hidden !important;
}

/* Print styles */
@media print {
    .search-form,
    .location-buttons,
    .location-contact {
        display: none;
    }
    
    .location-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .location-results {
        display: block;
    }
    
    .location-item {
        margin-bottom: 20px;
        page-break-inside: avoid;
    }
}