/**
 * Split View Layout (지도+리스트 병렬 표시)
 * 심리학 기반 디자인 시스템 적용
 */

/* ========================================
   Split View Container
   ======================================== */

.split-view-container {
    width: 100%;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    gap: 1.5rem;
    min-height: calc(100vh - 200px);
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================
   Split View Panels
   ======================================== */

.split-view-panel {
    background: white;
    border-radius: 16px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.split-view-panel:hover {
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Map Panel (왼쪽 55%) */
.map-panel {
    flex: 0 0 55%;
    position: relative;
}

/* Results Panel (오른쪽 45%) */
.results-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Panel Headers
   ======================================== */

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--calm-green) 0%, #21867A 100%);
    color: white;
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-map-fullscreen {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.25rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-map-fullscreen:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.btn-map-fullscreen:active {
    transform: scale(0.95);
}

/* ========================================
   Kakao Map Styling
   ======================================== */

.kakao-map {
    flex: 1;
    width: 100%;
    min-height: 500px;
    background: #f0f0f0;
    position: relative;
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: white;
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    gap: 16px;
    z-index: 10;
    animation: slideInFromLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s backwards;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
}

.legend-marker {
    font-size: 16px;
}

.legend-marker.user {
    color: #3b82f6;
}

.legend-marker.facility {
    font-size: 14px;
}

.legend-text {
    font-weight: 500;
}

/* ========================================
   Results Panel Styling
   ======================================== */

.results-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(to bottom, #ffffff 0%, #f9fafb 100%);
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 5;
}

.results-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.results-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-count {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.sort-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}

.sort-select:hover {
    border-color: var(--calm-green);
}

.sort-select:focus {
    outline: none;
    border-color: var(--calm-green);
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1);
}

/* Results List */
.results-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.results-list::-webkit-scrollbar {
    width: 8px;
}

.results-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.results-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.results-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Result Card Enhancements */
.result-card {
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.result-card.highlighted {
    transform: translateX(8px);
    box-shadow:
        0 10px 25px -5px rgba(42, 157, 143, 0.2),
        0 8px 10px -6px rgba(42, 157, 143, 0.1);
    border-left-width: 6px !important;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet (1024px 이하) */
@media (max-width: 1024px) {
    .split-view-container {
        flex-direction: column;
        gap: 1rem;
    }

    .map-panel {
        flex: 0 0 auto;
        height: 400px;
    }

    .results-panel {
        flex: 1;
        min-height: 500px;
    }

    .kakao-map {
        min-height: 300px;
    }
}

/* Mobile (768px 이하) */
@media (max-width: 768px) {
    .split-view-container {
        margin: 1rem auto;
        padding: 0 0.75rem;
    }

    .map-panel {
        height: 350px;
    }

    .panel-header {
        padding: 1rem;
    }

    .panel-title {
        font-size: 1.125rem;
    }

    .results-header {
        padding: 1rem;
    }

    .results-title {
        font-size: 1.125rem;
    }

    .results-list {
        padding: 0.75rem 1rem;
    }

    .map-legend {
        bottom: 10px;
        left: 10px;
        padding: 8px 12px;
        gap: 12px;
        font-size: 12px;
    }

    .legend-marker {
        font-size: 14px;
    }
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse animation for highlighted items */
@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(42, 157, 143, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(42, 157, 143, 0);
    }
}

.result-card.highlighted::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(42, 157, 143, 0.05) 0%, transparent 100%);
    pointer-events: none;
    animation: pulse 2s infinite;
}

/* No Results Styling */
.no-results {
    text-align: center;
    padding: 3rem 1.5rem;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.no-results-text {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
}

/* Pagination */
.pagination {
    padding: 1rem 1.5rem;
    border-top: 2px solid #e5e7eb;
    background: linear-gradient(to top, #ffffff 0%, #f9fafb 100%);
}