/* ============================================
   기본 설정
   ============================================ */
/* base.css의 스타일을 오버라이드하여 인증 페이지 전용 스타일 적용 */

html {
  height: 100% !important;
  overflow: hidden !important;
  /* base.css의 font-size는 유지 (변수 사용을 위해) */
}

body {
  font-family: "Pretendard", "Noto Sans KR", "Roboto", Arial, sans-serif !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  height: 100vh !important;
  min-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  /* base.css의 다른 스타일 오버라이드 */
  line-height: normal !important;
  color: inherit !important;
  background-color: transparent !important;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #E6F3FC;
  opacity: 0.5;
  z-index: -1;
}

/* base.css의 전역 전환 효과 오버라이드 */
.login-form a:hover,
.login-form button:hover {
  transform: none !important;
}

.login-form button:hover {
  transform: translateY(-1px) !important;
}

/* ============================================
   로그인 페이지 스타일
   ============================================ */

.login-container {
  background-color: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 0 0 0.625rem 0.625rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 24rem;
  text-align: center;
  position: relative;
}

h4 {
  font-size: var(--font-size-xl);
  color: white;
  background-color: #2885DC;
  font-weight: bold;
  margin: 0;
  padding: 1rem 0;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  border-radius: 0.625rem 0.625rem 0 0;
}

.logo-text {
  font-size: var(--font-size-3xl);
  font-weight: bold;
  color: #1A5FA8;
  margin-bottom: 2.5rem;
  margin-top: 0.5rem;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.875rem;
  border: 1px solid #ccc;
  border-radius: 0.75rem;
  font-size: var(--font-size-base);
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  outline: none;
  border-color: #4A9FE8;
  box-shadow: 0 0 0 0.2rem rgba(40, 133, 220, 0.25);
}

.login-form input[type="password"] {
  margin-bottom: 0;
}

.login-form button {
  background-color: #2885DC;
  color: white;
  border: none;
  margin-top: 1.5rem;
  margin-bottom: 0;
  border-radius: 0.75rem;
  width: 100%;
  height: 2.8125rem;
  max-width: 20rem;
  font-size: var(--font-size-base);
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.1s ease;
}

.login-form button:hover {
  background-color: #4A9FE8;
  transform: translateY(-1px);
}

.login-form button:active {
  background-color: #1E6FC4;
  transform: translateY(0);
}

.login-form button img.login-icon,
.login-form button img.password-icon {
  position: absolute;
  left: 0.9375rem;
  width: 1.25rem;
  height: 1.25rem;
}

.login-form button .login-icon {
  position: absolute;
  left: 0.9375rem;
  font-size: var(--font-size-base);
}

.exp {
  font-size: var(--font-size-sm);
  color: #d9534f;
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 0.5rem;
  text-align: center;
  background-color: #f8d7da;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  border: 1px solid #f5c6cb;
}

.tiptext {
  margin-top: 1.5rem;
  margin-bottom: 0;
  font-size: var(--font-size-xs);
}

.tiptext a {
  font-size: var(--font-size-sm);
  color: #5f6368;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.tiptext a:hover {
  color: #1A5FA8;
  text-decoration: underline;
}

.copyright {
  font-size: var(--font-size-sm);
  margin-top: 1.5rem;
  margin-bottom: 0;
  color: #6a6b6d;
}

/* ============================================
   Flash 메시지
   ============================================ */

.flash-message {
  margin-bottom: 1.5rem;
}

.flash-message p.error {
  color: red;
  font-size: var(--font-size-base);
  text-align: center;
  margin-bottom: 0;
}

/* ============================================
   레이아웃 - 상단 배너
   ============================================ */

.top-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background-color: #2885DC;
  color: white;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-height: 64px;
}

.top-banner-content {
  display: flex;
  align-items: center;
  flex: 1;
}

.top-banner-icon {
  font-size: var(--font-size-2xl);
  margin-right: 0.75rem;
  color: white;
}

.top-banner-text {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: white;
}

.test-mode-badge {
  display: inline-block;
  margin-left: 0.75rem;
  padding: 0.2rem 0.75rem;
  background-color: #ffc107;
  color: #000;
  font-size: var(--font-size-sm);
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 1px;
  animation: testBadgePulse 2s ease-in-out infinite;
}

@keyframes testBadgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.top-banner-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* 언어 토글 버튼 */
.language-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0.25rem;
}

.language-toggle .lang-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 40px;
}

.language-toggle .lang-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.language-toggle .lang-btn.active {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  font-weight: 600;
}

.user-info,
a.user-info,
a.user-info:hover,
a.user-info:visited,
a.user-info:active {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  font-size: var(--font-size-base);
}

.user-info-icon {
  font-size: var(--font-size-lg);
  color: white;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  color: white;
  text-decoration: none;
  font-size: var(--font-size-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logout-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: var(--font-size-2xl);
  color: white;
  cursor: pointer;
  padding: 0.5rem;
  margin-right: 1rem;
  transition: color 0.2s;
}

.mobile-menu-toggle:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   레이아웃 - 사이드바
   ============================================ */

.sidebar {
  width: 260px;
  background-color: #ffffff;
  border-right: 1px solid #e5e5e5;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
  position: fixed;
  left: 0;
  top: 64px;
  height: calc(100vh - 64px);
  overflow: visible;
  z-index: 1000;
  transition: width 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-toggle {
  position: absolute;
  right: -24px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  color: #666;
  font-size: var(--font-size-sm);
  cursor: pointer;
  width: 24px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  z-index: 1001;
  will-change: background-color, border-color, color;
}

.sidebar-toggle:hover {
  background-color: #f8f9fa;
  border-color: #2885DC;
  color: #2885DC;
  transform: translateY(-50%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sidebar.collapsed {
  width: 70px;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.03);
}

.sidebar.collapsed .sidebar-toggle {
  right: -24px;
  width: 24px;
  height: 32px;
  transform: translateY(-50%);
}

.sidebar.collapsed .sidebar-toggle:hover {
  transform: translateY(-50%);
}

.sidebar.collapsed .sidebar-toggle i {
  color: #666;
  font-size: var(--font-size-sm);
  display: inline-block;
}

.sidebar.collapsed .sidebar-menu-text {
  display: none;
}

.sidebar.collapsed .sidebar-menu-icon {
  margin-right: 0;
}

.sidebar.collapsed .sidebar-submenu-link {
  padding-left: 1rem;
  justify-content: center;
}

.sidebar.collapsed .sidebar-submenu-link i {
  margin-right: 0;
}

.sidebar.collapsed .sidebar-submenu-text {
  display: none;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-menu-item {
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-menu-link {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-menu-link:hover {
  background-color: #f8f9fa;
  color: #2885DC;
}

.sidebar-menu-link.active {
  background-color: #E6F3FC;
  color: #2885DC;
  font-weight: 600;
  border-left: 3px solid #2885DC;
}

.sidebar-menu-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: #2885DC;
}

.sidebar-menu-icon {
  font-size: var(--font-size-lg);
  width: 24px;
  margin-right: 0.75rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-menu-text {
  flex: 1;
  font-size: var(--font-size-lg);
  white-space: nowrap;
}

.sidebar-menu-arrow {
  font-size: var(--font-size-xs);
  margin-left: auto;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.sidebar-menu-item.open .sidebar-menu-arrow {
  transform: rotate(90deg);
}

.sidebar-submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: #f8f9fa;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar-menu-item.open .sidebar-submenu {
  max-height: 500px;
}

.sidebar-submenu-item {
  border-bottom: 1px solid #e9ecef;
}

.sidebar-submenu-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem 0.75rem 3rem;
  color: #666;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: var(--font-size-lg);
}

.sidebar-submenu-link:hover {
  background-color: #e9ecef;
  color: #2885DC;
}

.sidebar-submenu-link.active {
  background-color: #E6F3FC;
  color: #2885DC;
  font-weight: 600;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ============================================
   레이아웃 - 메인 컨텐츠
   ============================================ */

.main-content {
  margin-left: 260px;
  margin-top: 64px;
  transition: margin-left 0.3s ease;
  height: calc(100vh - 64px);
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
  width: calc(100% - 260px);
  overflow: hidden;
}

.sidebar.collapsed ~ .main-content {
  margin-left: 70px;
  width: calc(100% - 70px);
}

.content-wrapper {
  padding: 1.5rem;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ============================================
   반응형 디자인
   ============================================ */

/* 레이아웃 - 태블릿 (1200px 이하) */
@media (max-width: 1200px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  .sidebar.collapsed.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .sidebar-toggle {
    display: none;
  }

  .content-wrapper {
    padding: 1rem;
  }
}

/* 레이아웃 - 태블릿 (992px 이하) */
@media (max-width: 992px) {
   .top-banner-icon {
    font-size: var(--font-size-xl);
  }

  .language-toggle .lang-btn {
    padding: 0.25rem 0.5rem;
    font-size: var(--font-size-xs);
    min-width: 32px;
  }

  .top-banner-actions {
    gap: 0.75rem;
  }
}

/* 레이아웃 - 모바일 (768px 이하) */
@media (max-width: 768px) {
  .top-banner {
    padding: 0.75rem 1rem;
    min-height: 56px;
  }

  .top-banner-icon {
    margin-right: 0.5rem;
  }

  .user-info span {
    display: none;
  }

  .logout-btn span {
    display: none;
  }

  .logout-btn {
    padding: 0.375rem 0.5rem;
  }

  .content-wrapper {
    padding: 0.75rem;
  }

  .sidebar {
    width: 240px;
    top: 56px;
    height: calc(100vh - 56px);
  }

  .main-content {
    margin-top: 56px;
    height: calc(100vh - 56px);
  }

  /* 사이드바 메뉴 폰트 축소 */
  .sidebar-menu-text {
    font-size: var(--font-size-base);
  }

  .sidebar-submenu-link {
    font-size: var(--font-size-base);
  }
}

/* 레이아웃 - 소형 모바일 (576px 이하) */
@media (max-width: 576px) {
  .top-banner {
    padding: 0.5rem 0.75rem;
    min-height: 48px;
  }

  .top-banner-icon {
    font-size: var(--font-size-lg);
    margin-right: 0.375rem;
  }

  .top-banner-actions {
    gap: 0.375rem;
  }

  .language-toggle {
    padding: 0.125rem;
  }

  .language-toggle .lang-btn {
    padding: 0.2rem 0.375rem;
    font-size: 10px;
    min-width: 28px;
  }

  .user-info-icon {
    font-size: var(--font-size-base);
  }

  .logout-btn {
    padding: 0.25rem 0.5rem;
    font-size: var(--font-size-xs);
  }

  .logout-btn i {
    font-size: var(--font-size-sm);
  }

  .content-wrapper {
    padding: 0.5rem;
  }

  .sidebar {
    width: 220px;
    top: 48px;
    height: calc(100vh - 48px);
  }

  .main-content {
    margin-top: 48px;
    height: calc(100vh - 48px);
  }

  /* 사이드바 메뉴 추가 축소 */
  .sidebar-menu-link {
    padding: 0.75rem 0.875rem;
  }

  .sidebar-menu-icon {
    font-size: var(--font-size-base);
    width: 20px;
    margin-right: 0.5rem;
  }

  .sidebar-menu-text {
    font-size: var(--font-size-sm);
  }

  .sidebar-submenu-link {
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    font-size: var(--font-size-sm);
  }
}

/* 레이아웃 - 초소형 모바일 (480px 이하) */
@media (max-width: 480px) {
  .top-banner {
    min-height: 44px;
  }

  .top-banner-icon {
    font-size: var(--font-size-base);
  }


  .sidebar {
    width: 200px;
    top: 44px;
    height: calc(100vh - 44px);
  }

  .main-content {
    margin-top: 44px;
    height: calc(100vh - 44px);
  }
}
