/* ============================================
   Layout CSS - 헤더, 푸터, 기본 레이아웃
   통합 방문 간호 서비스
   ============================================ */

/* 메인 레이아웃 */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
}

/* ----------------------------------------
   헤더
   ---------------------------------------- */
.site-header {
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

/* 로고 */
.site-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.site-logo a {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-primary);
    font-weight: 700;
    font-size: var(--font-size-xl);
}

.site-logo a:hover {
    color: var(--color-primary-dark);
}

.site-logo img {
    height: 48px;
    width: auto;
}

/* 메인 네비게이션 */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--color-text);
    font-size: var(--font-size-base);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
}

/* 드롭다운 메뉴 */
.nav-item.has-dropdown {
    position: relative;
}

.nav-item.has-dropdown > .nav-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: default;
}

.nav-item.has-dropdown > .nav-link i {
    font-size: 0.625rem;
    transition: transform 0.2s;
}

.nav-item.has-dropdown:hover > .nav-link i {
    transform: rotate(180deg);
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 160px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    padding: 0.5rem 0;
    list-style: none;
    z-index: 100;
}

.nav-item.has-dropdown:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown li a {
    display: block;
    padding: 0.625rem 1.25rem;
    color: #374151;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: all 0.15s;
}

.nav-dropdown li a:hover {
    background: #f3f4f6;
    color: #3b82f6;
}

/* 헤더 액션 (로그인/회원가입) */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* 로그인 후 사용자 메뉴 */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    transition: all 0.2s;
}

.user-menu-toggle:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.user-menu-toggle i:first-child {
    font-size: 1.25rem;
}

.user-menu-toggle i:last-child {
    font-size: 0.75rem;
    opacity: 0.7;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 180px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: var(--color-bg-light);
}

.user-dropdown a i,
.user-dropdown button i {
    width: 1rem;
    text-align: center;
    color: var(--color-text-light);
}

.user-dropdown button {
    border-top: 1px solid var(--color-border);
    color: var(--color-danger);
}

.user-dropdown button i {
    color: var(--color-danger);
}

/* 모바일 메뉴 토글 */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    font-size: var(--font-size-xl);
}

/* ----------------------------------------
   푸터
   ---------------------------------------- */
.site-footer {
    background: #1a1f2e;
    color: #fff;
    padding: 3rem 0 0;
}

.footer-main {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand {
    max-width: 280px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
}

.footer-logo i {
    font-size: 1.5rem;
    color: #3b82f6;
}

.footer-desc {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.7;
}

.footer-nav {
    display: flex;
    gap: 4rem;
}

.footer-menu h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    text-decoration: none;
    padding: 0.375rem 0;
    transition: color 0.2s;
}

.footer-menu a:hover {
    color: #fff;
}

.footer-menu a i {
    font-size: 0.75rem;
    width: 1rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.5);
}

.footer-legal {
    display: flex;
    gap: 1.5rem;
}

.footer-legal a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-legal a:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .footer-main {
        flex-direction: column;
        gap: 2rem;
    }
    .footer-brand {
        max-width: 100%;
    }
    .footer-nav {
        flex-wrap: wrap;
        gap: 2rem;
    }
    .footer-menu {
        min-width: 140px;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ----------------------------------------
   섹션 레이아웃
   ---------------------------------------- */
.section {
    padding: var(--spacing-3xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: var(--font-size-3xl);
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-light);
}

/* ----------------------------------------
   히어로 섹션
   ---------------------------------------- */
.hero {
    background: #000000;
    color: #ffffff;
    padding: var(--spacing-3xl) 0;
}

.hero-simple {
    text-align: center;
    padding: var(--spacing-2xl) 0;
}

.hero-simple-title {
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -1px;
}

.hero-simple-subtitle {
    font-size: var(--font-size-xl);
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--spacing-xl);
}

.hero-search {
    display: flex;
    max-width: 500px;
    margin: 0 auto var(--spacing-2xl);
}

.hero-search-input {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-lg);
    border: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    outline: none;
}

.hero-search-input::placeholder {
    color: var(--color-text-muted);
}

.hero-search-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    background: #ffffff;
    border: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: #000000;
    font-size: var(--font-size-xl);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.hero-search-btn:hover {
    background: var(--color-bg-light);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.hero-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    color: #ffffff;
    text-decoration: none;
    transition: all var(--transition-base);
}

.hero-btn:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    transform: translateY(-4px);
}

.hero-btn i {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
}

.hero-btn span {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

/* ----------------------------------------
   그리드 레이아웃
   ---------------------------------------- */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ----------------------------------------
   컨텐츠 영역
   ---------------------------------------- */
.content-area {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--spacing-xl);
}

.content-main {
    min-width: 0;
}

.content-sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--spacing-lg));
    height: fit-content;
}

/* 사이드바 위젯 */
.sidebar-widget {
    background-color: var(--color-bg-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.sidebar-widget-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--color-primary);
}
