/* Modern Index CSS - Tailwind-inspired Aesthetic */

:root {
    /* Colors */
    --primary: #3b82f6;
    /* Blue 500 */
    --primary-hover: #2563eb;
    /* Blue 600 */
    --secondary: #64748b;
    /* Slate 500 */
    --accent: #f59e0b;
    /* Amber 500 */

    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-white: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.9);

    --text-main: #1e293b;
    /* Slate 800 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #94a3b8;
    /* Slate 400 */
    --text-white: #ffffff;

    --border-color: #e2e8f0;
    /* Slate 200 */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Spacing & Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;

    --container-width: 1200px;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Header */
.main-header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.logo-area img {
    height: 32px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link {
    color: var(--text-main);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-item-group {
    position: relative;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.nav-item-group:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-main);
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: var(--text-white);
    padding: 4rem 0 6rem;
    /* Bottom padding accommodates overlapping categories */
    text-align: center;
    position: relative;
    overflow: visible;
}

/* Abstract Background Shapes */
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    transform: rotate(-15deg);
    pointer-events: none;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 2.5rem;
}

/* Search Bar */
.search-wrapper {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 20;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    padding-right: 3.5rem;
    font-size: 1.1rem;
    border: none;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    outline: none;
    transition: box-shadow 0.2s;
}

.search-input:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    color: var(--text-muted);
    font-size: 1.25rem;
}

/* Live Search Results */
.homeSearch {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    margin-top: 0.75rem;
    z-index: 9999;
    text-align: left;
    overflow: hidden;
    display: none;
    /* Toggled by JS */
    max-height: 400px;
    overflow-y: auto;
}

.selectApt {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background 0.15s;
}

.selectApt:last-child {
    border-bottom: none;
}

.selectApt:hover {
    background-color: #f8fafc;
}

/* Categories Grid */
.categories-section {
    margin-top: -3rem;
    /* Overlap hero */
    padding-bottom: 3rem;
    position: relative;
    z-index: 10;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.category-card {
    background: var(--bg-white);
    padding: 1.5rem 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    border: 1px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: #eff6ff;
    /* Blue 50 */
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    transition: background 0.2s, color 0.2s;
}

.category-card:hover .category-icon {
    background: var(--primary);
    color: var(--bg-white);
}

.category-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1rem;
}

/* Banner Section */
.banner-section {
    padding: 2rem 0 4rem;
}

.banner-slider-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
    background: var(--bg-white);
    max-width: 600px;
    height: 160px;
    margin-left: auto;
    margin-right: auto;
}

.banner-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.large-slider .banner-slider {
    height: 450px;
}

.medium-slider .banner-slider {
    height: 300px;
}

.small-slider .banner-slider {
    height: 100%;
}

.banner-slides {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
    width: 100%;
    /* Ensure it takes full width of parent */
}

.banner-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    flex-shrink: 0;
    /* Prevent slides from shrinking */
}

.banner-item {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.banner-item:hover img {
    transform: scale(1.03);
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 2rem;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
}

.banner-item:hover .banner-overlay {
    opacity: 1;
    transform: translateY(0);
}

.banner-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Banner Navigation */
.banner-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    color: #1e293b;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 30;
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.banner-slider-container:hover .banner-nav-btn {
    opacity: 1;
}

.banner-nav-btn:hover {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.banner-prev {
    left: 1rem;
}

.banner-next {
    right: 1rem;
}

.banner-indicators {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 20;
}

.banner-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    padding: 0;
    transition: all 0.3s;
}

.banner-indicator.active {
    background: white;
    transform: scale(1.2);
}

/* Small Banner Grid Layout */
.small-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    height: 100%;
    padding: 0;
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
    max-width: 500px;
    width: 90%;
    animation: popupFadeIn 0.3s ease-out;
}

.agreeBtnArea {
    padding: 10px;
    display: flex;
    justify-content: flex-end;
    overflow: hidden;
    border-top: 1px solid #ccc;
}

.btn-area {
    display: flex;
    justify-content: flex-end;
    overflow: hidden;
    text-align: center;
    gap: 15px;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.popup-header {
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.popup-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}

.popup-close:hover {
    opacity: 1;
}

.popup-body {
    padding: 1.5rem;
}

.popup-image {
    width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.popup-controls {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.popup-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    border: none;
    transition: background 0.2s;
}

.popup-btn-close {
    background: #e2e8f0;
    color: var(--text-main);
}

.popup-btn-close:hover {
    background: #cbd5e1;
}

.popup-btn-next {
    background: var(--primary);
    color: white;
    margin-left: 0.5rem;
}

.popup-btn-next:hover {
    background: var(--primary-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        padding: 0 1rem;
    }

    .nav-menu {
        display: none;
        /* Mobile menu to be implemented if needed, or simplified */
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-section {
        padding: 3rem 0 5rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .small-container {
        grid-template-columns: 1fr;
    }

    .large-slider .banner-slider {
        height: 250px;
    }

    .medium-slider .banner-slider {
        height: 200px;
    }
}