@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Pretendard:wght@400;500;600;700&display=swap");

:root {
  /* [기본 다크모드 상태] */
  --sb-bg: rgba(3, 7, 18, 0.85);
  --sb-border: rgba(255, 255, 255, 0.06);
  --sb-text: #f3f4f6;
  --sb-text-muted: #9ca3af;
  --sb-hover-bg: rgba(99, 102, 241, 0.15);
  --sb-hover-text: #ffffff;
  --sb-input-bg: #111827;
  --sb-profile-bg: rgba(15, 23, 42, 0.6);
  --sb-tooltip-bg: #111827;
  --sb-tooltip-text: #f3f4f6;
  --main-content-bg: #030712;
  --main-text: #ffffff;
}

/* html이나 body 태그에 data-theme="light"가 주입되면 사이드바 색상도 동시에 반전 */
[data-theme="light"] {
  --sb-bg: rgba(255, 255, 255, 0.85);
  --sb-border: rgba(15, 23, 42, 0.08);
  --sb-text: #0f172a;
  --sb-text-muted: #475569;
  --sb-hover-bg: rgba(6, 182, 212, 0.1);
  --sb-hover-text: #06b6d4;
  --sb-input-bg: #f1f5f9;
  --sb-profile-bg: rgba(241, 245, 249, 0.9);
  --sb-tooltip-bg: #ffffff;
  --sb-tooltip-text: #0f172a;
  --main-content-bg: #f8fafc;
  --main-text: #0f172a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Pretendard", "Poppins", sans-serif;
}

body {
  position: relative;
  min-height: 100vh;
  width: 100%;
  background-color: var(--main-content-bg);
  color: var(--main-text);
  overflow-x: hidden;
  transition: background-color 0.3s;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  z-index: 9999;
  width: 78px;
  background: var(--sb-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 12px 14px;
  border-right: 1px solid var(--sb-border);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
}

.sidebar.active {
  width: 250px;
}

/* 상단 로고 구역 */
.sidebar .logo_content {
  position: relative;
  height: 50px;
  width: 100%;
  display: flex;
  align-items: center;
}

.sidebar .logo_content .logo {
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar.active .logo_content .logo {
  opacity: 1;
  pointer-events: auto;
}

.logo img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
  /* 둥근 사각형으로 트렌디하게 변경 */
}

.logo .logo_name {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.05em;
}

/* 토글 햄버거 버튼 디자인 */
.sidebar #btn {
  position: absolute;
  color: var(--sb-text);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  height: 42px;
  width: 42px;
  text-align: center;
  line-height: 42px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
}

.sidebar #btn:hover {
  background: var(--sb-hover-bg);
  color: var(--sb-hover-text);
}

.sidebar.active #btn {
  left: 90%;
}

/* 내비게이션 리스트 */
.sidebar ul.nav_list {
  margin-top: 32px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar ul li {
  position: relative;
  height: 46px;
  width: 100%;
}

/* 메뉴 내부 링크 및 아이콘 */
.sidebar ul li a {
  color: var(--sb-text-muted);
  display: flex;
  align-items: center;
  height: 100%;
  width: 100%;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.25s;
  white-space: nowrap;
}

.sidebar ul li a:hover {
  color: var(--sb-hover-text);
  background: var(--sb-hover-bg);
}

.sidebar ul li i {
  height: 46px;
  min-width: 50px;
  border-radius: 10px;
  line-height: 46px;
  text-align: center;
  font-size: 20px;
  color: var(--sb-text-muted);
  transition: color 0.25s;
}

.sidebar ul li a:hover i {
  color: var(--sb-hover-text);
}

.sidebar .links_name {
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.sidebar.active .links_name {
  opacity: 1;
  pointer-events: auto;
}

.sidebar ul li input {
  position: absolute;
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
  border-radius: 10px;
  outline: none;
  border: 1px solid var(--sb-border);
  background: var(--sb-input-bg);
  padding-left: 50px;
  font-size: 0.9rem;
  color: var(--sb-text);
  transition: all 0.3s;
}

.sidebar ul li .bx-search {
  position: absolute;
  z-index: 99;
  color: var(--sb-text-muted);
  font-size: 20px;
  cursor: pointer;
}

.sidebar ul li .tooltip {
  position: absolute;
  left: 90px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 6px;
  padding: 6px 14px;
  background: var(--sb-tooltip-bg);
  color: var(--sb-tooltip-text);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--sb-border);
  opacity: 0;
  pointer-events: none;
  z-index: 10000;
  transition: all 0.2s;
}

.sidebar:not(.active) ul li:hover .tooltip {
  opacity: 1;
  left: 84px;
}

.sidebar.active ul li .tooltip {
  display: none;
}

.sidebar .profile_content {
  margin-top: auto;
  /* 리스트 최하단 하이퍼 락킹 */
  width: 100%;
}

.sidebar .profile_content .profile {
  position: relative;
  padding: 8px;
  height: 60px;
  border-radius: 12px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
}

.sidebar.active .profile_content .profile {
  background: var(--sb-profile-bg);
  border: 1px solid var(--sb-border);
}

.profile_content .profile .profile_details {
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.sidebar.active .profile .profile_details {
  opacity: 1;
  pointer-events: auto;
}

.profile .profile_details img {
  height: 38px;
  width: 38px;
  object-fit: cover;
  border-radius: 8px;
}

.profile .profile_details .name_job {
  margin-left: 12px;
}

.profile .profile_details .name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--sb-text);
}

.profile .profile_details .job {
  font-size: 0.75rem;
  color: var(--sb-text-muted);
  margin-top: 2px;
}

/* 세션 스위칭 아이콘 버튼 리프레시 */
.profile #log_in,
.profile #log_out {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  color: var(--sb-text-muted);
  cursor: pointer;
  transition: all 0.3s;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 8px;
}

.profile #log_in:hover {
  color: #06b6d4;
  background: var(--sb-hover-bg);
}

.profile #log_out:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.sidebar.active .profile #log_in,
.sidebar.active .profile #log_out {
  left: 85%;
}

.home_content {
  position: absolute;
  min-height: 100vh;
  width: calc(100% - 78px);
  left: 78px;
  padding: 40px;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  background-color: var(--main-content-bg);
}

.home_content .text {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--main-text);
}

.sidebar.active~.home_content {
  width: calc(100% - 250px);
  left: 250px;
}