/* 추가 CSS 스타일 - 허접한 부분 개선 */

/* 헤더 개선 */
.header {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header.header-hidden {
    transform: translateY(-100%);
}

/* 로딩 스타일 개선 */
.loader-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-content {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4a90f2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* 검색 제안 개선 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f8f9fa;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

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

.suggestion-text {
    font-weight: 500;
    color: #333;
}

.suggestion-type {
    font-size: 0.8rem;
    color: #666;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 모바일 메뉴 개선 */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    padding: 2rem;
}

.mobile-menu.active {
    right: 0;
}

.menu-open {
    overflow: hidden;
}

.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

/* 비즈니스 카드 개선 */
.business-card {
    position: relative;
    overflow: hidden;
}

.business-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(74, 144, 242, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.business-card:hover::before {
    opacity: 1;
}

.business-image {
    position: relative;
    overflow: hidden;
}

.business-image img {
    transition: transform 0.3s ease;
}

.business-card:hover .business-image img {
    transform: scale(1.05);
}

/* 레이지 로딩 이미지 */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

/* 스켈레톤 로딩 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* 폼 개선 */
.form-floating {
    position: relative;
}

.form-floating > .form-control {
    height: calc(3.5rem + 2px);
    padding: 1rem 0.75rem;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* 접근성 개선 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 포커스 스타일 개선 */
.btn:focus,
.form-control:focus,
a:focus {
    outline: 2px solid #4a90f2;
    outline-offset: 2px;
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --border-color: #333;
    }
    
    body {
        background: var(--bg-color);
        color: var(--text-color);
    }
    
    .header {
        background: rgba(26, 26, 26, 0.95);
    }
    
    .form-control {
        background: #2a2a2a;
        border-color: var(--border-color);
        color: var(--text-color);
    }
    
    .card {
        background: #2a2a2a;
        border-color: var(--border-color);
    }
}

/* 인쇄 스타일 */
@media print {
    .header,
    .footer,
    .btn,
    .mobile-menu,
    .search-suggestions {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .business-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        padding: 1rem;
    }
}

/* 고해상도 디스플레이 최적화 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-text {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 모션 감소 설정 존중 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 성능 최적화를 위한 will-change */
.header {
    will-change: transform;
}

.business-card {
    will-change: transform;
}

.btn:hover {
    will-change: transform;
}

/* 터치 디바이스 최적화 */
@media (hover: none) {
    .business-card:hover::before {
        opacity: 0;
    }
    
    .business-card:hover .business-image img {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* 크로스 브라우저 호환성 */
.search-bar {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* IE11 지원 (필요시) */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .grid {
        display: block;
    }
    
    .grid > * {
        display: inline-block;
        vertical-align: top;
        width: 32%;
    }
}
