/* 엔뷰 디자인 시스템 */
:root {
    --nview-primary: #667eea;
    --nview-secondary: #764ba2;
    --nview-dark: #5a4fcf;
    --nview-accent: #ffd700;
    --nview-bg: #f8f9fa;
    --nview-text: #212124;
    --nview-text-light: rgba(255, 255, 255, 0.85);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--nview-bg);
    color: var(--nview-text);
}

/* 사이드바 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 50%, #5a4fcf 100%);
    color: white;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 32px rgba(102, 126, 234, 0.25);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    font-size: 26px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-logo i {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 28px;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    border: none;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-section {
    margin-bottom: 30px;
}

.menu-section-title {
    padding: 14px 20px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1.2px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 8px;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    margin: 2px 12px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.sidebar-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #ffd700, #ffed4e);
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 0 4px 4px 0;
}

.sidebar-menu-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    text-decoration: none;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar-menu-item:hover::before {
    opacity: 1;
}

.sidebar-menu-item.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    color: white;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.sidebar-menu-item.active::before {
    opacity: 1;
    width: 6px;
}

.sidebar-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar-menu-item:hover .sidebar-icon {
    transform: scale(1.1);
}

.sidebar-text {
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 1;
    transition: all 0.3s ease;
    font-weight: 500;
}

/* 메인 레이아웃 */
.main-layout {
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.4s ease;
}

/* 헤더 */
.header-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 40px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 검색 메인 */
.search-main {
    padding: 20px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    position: relative;
}


.search-container {
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
}

/* 검색 헤더 컨테이너 */
.search-header-container {
    background: white;
    border-radius: 20px;
    padding: 35px 40px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.search-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.search-header-main {
    flex: 1;
}

.search-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--nview-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.search-title i {
    font-size: 36px;
    color: #FFEB3B;
    margin-right: 12px;
}

.search-subtitle {
    color: #666;
    margin-bottom: 0;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    line-height: 1.6;
}

.search-subtitle i {
    color: var(--nview-secondary);
    font-size: 14px;
    margin-right: 6px;
}

.search-header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.info-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-wrap: wrap;
}

.info-badge i {
    color: #ffd700;
    font-size: 18px;
    animation: rocket-pulse 2s ease-in-out infinite;
}

@keyframes rocket-pulse {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-2px) scale(1.05);
    }
}

.info-badge .badge-separator {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    margin: 0 4px;
}

.info-badge .badge-text {
    font-weight: 500;
    opacity: 0.95;
}

.info-description {
    color: #868B94;
    font-size: 13px;
    font-weight: 500;
    text-align: right;
    line-height: 1.5;
    margin-top: 8px;
    padding: 8px 12px;
    background: #00BCD4;
    border-radius: 8px;
    border-left: 3px solid var(--nview-primary);
}

/* 검색 폼 */
.search-form-card {
    background: white;
    border-radius: 20px;
    padding: 25px 30px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.12);
    margin-bottom: 30px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.search-form-card:hover {
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.18);
    transform: translateY(-2px);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--nview-text);
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #E4E5E8;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--nview-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.form-control:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.form-check-input {
    margin-right: 8px;
}

.btn-search {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.btn-search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 진행률 */
.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #E4E5E8;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

/* 결과 영역 */
.results-container {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.results-header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-region-info {
    display: none;
}

.region-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    color: var(--nview-primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.region-badge i {
    color: var(--nview-secondary);
    font-size: 14px;
}

.region-text {
    font-weight: 700;
    color: var(--nview-primary);
}

.region-subtitle {
    font-weight: 500;
    color: #868B94;
    margin-left: 4px;
}

.search-region-badge {
    position: relative;
}

.results-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.results-count {
    font-size: 18px;
    font-weight: 600;
    color: var(--nview-primary);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

@media (min-width: 1400px) {
    .results-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .results-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .results-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card .product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card .product-link-btn {
    margin-top: auto;
    padding-top: 12px;
}

.product-card .product-link-btn .btn {
    background: var(--nview-primary);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.product-card .product-link-btn .btn:hover {
    background: var(--nview-secondary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f0f0f0;
}

.product-info {
    padding: 16px;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--nview-primary);
    margin-bottom: 8px;
}

.product-location {
    font-size: 12px;
    color: #868B94;
    margin-bottom: 4px;
}

.product-date {
    font-size: 12px;
    color: #868B94;
}

/* ============================================
   페이지 진입 애니메이션 (엔뷰 동일)
============================================ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-slide-in {
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

/* 반응형 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-layout {
        margin-left: 0;
    }
    
    .search-main {
        padding: 15px 20px;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .search-header-container {
        padding: 25px 20px;
    }
    
    .search-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .search-header-info {
        align-items: flex-start;
        width: 100%;
    }
    
    .info-description {
        text-align: left;
    }
    
    .search-title {
        font-size: 24px;
    }
    
    .search-subtitle {
        font-size: 14px;
    }
    
    .search-form-card {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* 애니메이션 감소 모드 지원 */
@media (prefers-reduced-motion: reduce) {
    .animate-slide-in,
    .animate-fade-in {
        animation: none;
        opacity: 1;
    }
}

