/* =========================================
   2. 사이드바 (폭 260px 및 수직 레이아웃)
   ========================================= */
.sidebar {
    width: 260px !important;
    min-width: 260px !important;
    height: 100vh;
    background: #f5f5f5;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;/* 헤더와 컨텐츠 분리 */
    z-index: 3;
    position: relative;
}

/* 사이드바 헤더 (고정) */
.sidebar-header {
    padding: 20px;
    flex-shrink: 0; /* 높이 줄어들지 않게 고정 */
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    text-align: center;
}

.sidebar-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.9;
}

/* 사이드바 내부 컨텐츠 (스크롤) */
.sidebar-content {
    flex: 1; /* 남은 공간 모두 차지 */
    overflow-y: auto; /* 내용 넘치면 스크롤 */
    padding: 10px;
}

.sidebar-footer {
    background: #f9f9f9; /* 배경을 살짝 다르게 하면 더 깔끔합니다 */
}

/* =========================================
   사용자 정보
   ========================================= */
.user-box {
    background: white;
    padding: 15px 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-info {
    display: flex !important;
    flex-direction: column !important;/* 세로 정렬 */
    
    align-items: center !important;
    text-align: center;
    gap: 15px !important;/* 문구와 버튼 사이 여유 공간 */
    
    width: 100% !important;
}

.greeting-text {
    display: block !important;
    font-size: 13px !important;
    line-height: 1.6 !important;    /* 글자 겹침 방지 */
    color: #4b5563;
    word-break: keep-all;
}

.greeting-text .highlight {
    color: var(--primary-color);
    font-weight: 800;
}

/* 시작하기 버튼 (그라데이션 스타일) */
.btn-auth-start {
    display: block !important;/* 1. 너비 문제 해결: 인라인 속성을 차단하고 한 줄을 다 쓰게 함 */
    width: 100% !important;
    padding: 12px 0 !important;/* 2. 글자 넘침 방지: 높이를 글자보다 여유 있게 설정 */
    line-height: 1.2 !important;
    border-radius: 6px !important;/* 3. 디자인 교정: 타원형이 아닌 깔끔한 사각형 곡면 */
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2) !important;
    text-align: center !important;
}

/* 버튼을 감싸는 컨테이너도 너비 100% 확인 */
.auth-btn-container {
    width: 100% !important;
    display: block !important;
}

/* 로그아웃 버튼 전용 스타일 */
button.btn-logout-link {
    /* 기존 '시작하기' 버튼의 회색 스타일 초기화 */
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;

    /* 새로운 디자인 입히기 */
    color: #999 !important;
    /* 연한 회색 글자 */
    text-decoration: underline;
    font-size: 13px;
    cursor: pointer;
    padding: 0 5px !important;
    margin-left: 8px;
    display: inline-block;
    width: auto !important;
    /* 버튼이 꽉 차지 않게 */
    height: auto !important;
}

/* 마우스 올렸을 때만 강조 */
button.btn-logout-link:hover {
    color: #ff4d4f !important;
    /* 붉은색으로 변경 */
    background: none !important;
}

/* 사용자 이름 태그도 같이 깔끔하게 */
.user-name-tag {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* =========================================
   로그인 후 사용자 프로필 UI 개선
   ========================================= */
.user-profile {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px !important;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%) !important;
    border-radius: 10px !important;
    border: 1px solid #e5e9ff !important;
}

.user-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    color: white !important;
    font-weight: bold !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
}

.user-details {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    min-width: 0 !important;
}

.user-welcome {
    font-size: 12px !important;
    color: #6b7280 !important;
    font-weight: 500 !important;
}

.user-name-display {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.user-logout {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 6px !important;
    background: white !important;
    border: 1px solid #e5e7eb !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    flex-shrink: 0 !important;
}

.user-logout:hover {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
}

.user-logout i {
    font-size: 14px !important;
    color: #6b7280 !important;
}

.user-logout:hover i {
    color: #dc2626 !important;
}


.section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.section h3 {
    font-size: 14px;
    margin-bottom: 10px;
}
/* =========================================
   사용자 정보 아래 검색어 입력창
   ========================================= */
   .search-input-box {
    display: flex;
    align-items: center;
    width: 100%;
    /* 부모(.search-container-box) 너비와 동일하게 */
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 2px 10px;
    background: #fff;
    margin-bottom: 10px;
    /* 버튼과의 간격 */
    box-sizing: border-box;
    /* 테두리 포함 너비 계산 */
}

.search-input-box input {
    flex: 1;
    width: 0;
    border: none;
    outline: none;
    padding: 10px 0;
    font-size: 15px;
}

.search-input-box:focus-within {
    border-color: #2980b9;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.2);
}

/* [핵심] 입력창 너비 강제 조절 */
.search-input-box input {
    flex: 1;
    /* 남은 공간을 모두 차지하되 */
    width: 0;
    /* 기본 너비를 0으로 주어 부모를 뚫고 나가지 않게 함 */
    min-width: 0;
    /* flex 아이템의 최소 너비 제한 해제 */
    border: none;
    outline: none;
    padding: 8px;
    font-size: 15px;
}

/* 돋보기 버튼 (너비 고정) */
.search-input-box button {
    flex-shrink: 0;/* 버튼은 크기가 줄어들지 않도록 고정 */
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    padding: 5px;
}

/* =========================================
   검색 모드 (내주변, 지역별)
   ========================================= */
.search-mode-btns {
    display: flex;
    gap: 8px;
}

.search-mode-btn {
    flex: 1;
    padding: 8px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.search-mode-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 지역별 */
.region {
    display: none;
}

.region.active {
    display: block;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

/* =========================================
   카테고리 필터
   ========================================= */
.select-all {
    background: #667eea;
    color: white;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 13px;
}

.cat-group {
    margin-bottom: 12px;
}

.cat-group h4 {
    font-size: 13px;
    margin-bottom: 5px;
    color: #666;
}

.cat-group label {
    display: flex;
    align-items: center;
    padding: 4px 0;
    cursor: pointer;
    font-size: 13px;
}

.cat-group input {
    margin-right: 8px;
}