:root {
  --white-color: #ffffff;
  --primary-color: #2563eb;
  --secondary-color: #6c757d;
  --p-color: #333333;
  --p-font-size: 1rem;
  --menu-font-size: 0.95rem;
  --font-weight-bold: 700;
  --font-weight-medium: 500;
  --dark-color: #111;
  --copyright-font-size: 0.8rem;
  --p-bg-color: #555;
  --h6-font-size: 1.1rem;
}

/* 기본 배경 및 다크모드 설정 */
.lang-select {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 999;
}
body {
  background-color: #f8f9fa;
  padding-top: 50px;
  --text-color: #ffffff;
}
body[data-theme="dark"] {
  background-color: #121212;
  color: #f1f1f1;
}

/* 카드 & 입력 필드 */
.card {
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
body[data-theme="dark"] .card {
  background-color: #1e1e1e;
  border: 1px solid #444;
  color: #f1f1f1;
}
input, textarea {
  background-color: white;
  color: black;
}
body[data-theme="dark"] input,
body[data-theme="dark"] textarea {
  background-color: #2c2c2c;
  color: #f1f1f1;
  border-color: #555;
}
body[data-theme="dark"] input.form-control {
  background-color: #ffffff;
  color: #000000;
  border-color: #888;
}

/* 버튼 */
.btn-primary {
  background-color: #4c6ef5;
  border: none;
}
.btn-primary:hover {
  background-color: #3b5bdb;
}
.btn-success {
  background-color: #40c057;
  border: none;
}
.btn-success:hover {
  background-color: #2f9e44;
}
body[data-theme="dark"] .btn-outline-primary,
body[data-theme="dark"] .btn-outline-info,
body[data-theme="dark"] #logoutBtn {
  color: #ccc;
  border-color: #ccc;
}
.btn-custom {
  font-size: 1.3rem;
  padding: 15px 30px;
  margin: 10px auto;
  width: 80%;
  display: block;
}
.btn-strong {
  background: hotpink;
  color: white;
  border: none;
  padding: 10px;
  margin: 8px;
  font-weight: bold;
  cursor: pointer;
}
.btn-disabled {
  background: gray;
  color: white;
  padding: 10px;
  margin: 8px;
  cursor: not-allowed;
}

/* 아이콘 메뉴 */
.icon-menu {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* ✅ 고정 3칸 */
  gap: 20px;
  justify-items: center;
  justify-content: center;
  max-width: 1000px;
  margin: 0 auto;
}
.icon-item {
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: #222;
  font-weight: 500;
}
.icon-circle {
  background-color: white;
  border-radius: 50%;
  width: 100px;
  height: 100px;
  margin: 0 auto 10px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.icon-circle img {
  width: 50px;
  height: 50px;
}
.icon-item p {
  margin: 0;
  font-size: 16px;
  letter-spacing: 1px;
}
body[data-theme="dark"] .icon-item p {
  color: #f1f1f1;
}

/* 제목 */
h1 {
  font-weight: bold;
  color: #343a40;
}
body[data-theme="dark"] h1,
body[data-theme="dark"] .form-label {
  color: var(--text-color);
}

/* 모달 */
#rewardModal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  color: black;
  padding: 1.5rem 2rem;
  border-radius: 1rem;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  text-align: center;
}
#rewardModal button {
  margin-top: 1rem;
  padding: 0.5rem 1.2rem;
  font-weight: bold;
}
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.7);
  display: flex; justify-content: center; align-items: center;
  z-index: 1000;
}
.modal-content {
  background: #111;
  padding: 2rem;
  border-radius: 12px;
  border: 1px dashed hotpink;
  color: white;
  text-align: center;
  width: 300px;
}
body[data-theme="dark"] .modal-content {
  background: #222;
  border-color: hotpink;
  color: white;
}

/* 기타 요소 */
.progress-bar {
  background-color: #4c6ef5;
}
.preview-container {
  margin-bottom: 80px;
}
body {
  padding-bottom: 150px; /* 하단 광고 공간 확보 */
}
.top-bar {
  text-align: right;
  margin: 10px 30px;
}
#userInfo {
  font-weight: bold;
  margin-bottom: 10px;
}

/* 연락처 */
.contact-block, .contact-grid {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #222;
}
.contact-block div, .contact-col {
  margin: 0.3rem 0;
  text-align: center;
  opacity: 0.8;
}
.contact-block a,
.contact-col a {
  text-decoration: none;
  color: inherit;
}
.contact-grid {
  display: flex;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
  text-align: left;
}
.contact-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
@media (prefers-color-scheme: dark) {
  .contact-grid,
  .contact-block,
  .contact-section {
    color: #fff;
    opacity: 0.5;
  }
  [data-lang="copyright"] {
    color: white;
  }
}
body[data-theme="dark"] h1,
body[data-theme="dark"] label,
body[data-theme="dark"] .form-label,
body[data-theme="dark"] #userInfo {
  color: #f1f1f1;
}

body[data-theme="dark"] input,
body[data-theme="dark"] textarea {
  background-color: #2c2c2c;
  color: #f1f1f1;
  border-color: #555;
}

body[data-theme="dark"] .progress-bar {
  background-color: hotpink;
}

body[data-theme="dark"] .text-secondary {
  color: #aaa !important;
}

.sticky-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: 90px;
  background-color: #FFFFFF;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 50px 10px 10px;
  box-sizing: border-box;
}
.sticky-ad button#close-ad {
  position: absolute;
  right: 10px;
  top: 10px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: #888;
}
.sticky-ad button#close-ad:hover {
  color: #000;
}
@media screen and (max-width: 600px) {
  .sticky-ad {
    padding: 10px 40px 10px 10px;
  }
  .sticky-ad button#close-ad {
    top: 8px;
    right: 8px;
  }
}
#idle-popup-ad {
  height: 100vh !important;
  width: 100vw !important;
  position: fixed !important;
  z-index: 2147483647 !important;
}
.ad-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.5); /* 반투명 배경 */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483647;
}
.ad-modal-content {
  background: white;
  max-width: 360px;
  width: 90%;
  padding: 16px;
  border-radius: 12px;
  min-height: 250px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  box-sizing: border-box;
}
.ad-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: #555;
}
.ad-modal-header button {
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: #888;
}
.ad-modal-header button:hover {
  color: #000;
}

.main-nav {
  /* background: #112237; */
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* 컨테이너 정렬 */
.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar {
  width: 100%;
  /* background-color: #112237; ✅ 남색 - 로고에 어울리는 색 */
  padding: 0.8rem 2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 9;
  position: sticky;
  top: 0;
}

.navbar-brand {
  color: var(--primary-color);
  font-size: var(--h6-font-size);
  font-weight: var(--font-weight-bold);
}

.navbar-brand span {
  display: inline-block;
  vertical-align: middle;
}

.navbar-brand small {
  color: var(--secondary-color);
  display: block;
  font-size: 10px;
  line-height: normal;
  text-transform: uppercase;
}

.logo {
  width: 80px;
  height: auto;
}

.navbar-expand-lg .navbar-nav .nav-link {
  margin-right: 0;
  margin-left: 0;
  padding: 20px;
}

.navbar-nav .nav-link {
  display: inline-block;
  color: var(--p-color);
  font-size: var(--p-font-size);
  font-weight: var(--font-weight-medium);
  position: relative;
  padding-top: 15px;
  padding-bottom: 15px;
}

.navbar-nav .nav-link.active, 
.navbar-nav .nav-link:hover {
  background: transparent;
  color: var(--primary-color);
}

.dropdown-menu {
  min-width: 220px;           /* 충분한 너비 확보 */
  max-width: 100%;            /* 필요 시 확장 가능 */
  padding: 0.5rem 0;
  border-radius: 12px;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
  display: block;             /* inline-block ➜ block */
  padding: 10px 16px;
  white-space: nowrap;        /* 한 줄로 유지 */
  font-size: 1rem;
  color: #333;
}

.dropdown-menu li:last-child .dropdown-item {
  padding-top: 0;
}

.dropdown-item.active, 
.dropdown-item:active,
.dropdown-item:focus, 
.dropdown-item:hover {
  background-color: #f1f3f5;
  color: #2563eb;
}

.dropdown-toggle::after {
  content: "\f282";
  display: none;
  font-family: bootstrap-icons !important;
  font-size: var(--copyright-font-size);
  font-style: normal;
  font-weight: normal !important;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  vertical-align: -.125em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  left: 2px;
  border: 0;
}

@media screen and (min-width: 992px) {
  .dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
  }
}

.navbar-toggler {
  border: 0;
  padding: 0;
  cursor: pointer;
  margin: 0;
  width: 30px;
  height: 35px;
  outline: none;
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='white' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
  background: transparent;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:before,
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:after {
  transition: top 300ms 50ms ease, -webkit-transform 300ms 350ms ease;
  transition: top 300ms 50ms ease, transform 300ms 350ms ease;
  transition: top 300ms 50ms ease, transform 300ms 350ms ease, -webkit-transform 300ms 350ms ease;
  top: 0;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:before {
  transform: rotate(45deg);
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:after {
  transform: rotate(-45deg);
}

.navbar-toggler .navbar-toggler-icon {
  background: var(--dark-color);
  transition: background 10ms 300ms ease;
  display: block;
  width: 30px;
  height: 2px;
  position: relative;
}

.navbar-toggler .navbar-toggler-icon:before,
.navbar-toggler .navbar-toggler-icon:after {
  transition: top 300ms 350ms ease, -webkit-transform 300ms 50ms ease;
  transition: top 300ms 350ms ease, transform 300ms 50ms ease;
  transition: top 300ms 350ms ease, transform 300ms 50ms ease, -webkit-transform 300ms 50ms ease;
  position: absolute;
  right: 0;
  left: 0;
  background: var(--dark-color);
  width: 30px;
  height: 2px;
  content: '';
}

.navbar-toggler .navbar-toggler-icon::before {
  top: -8px;
}

.navbar-toggler .navbar-toggler-icon::after {
  top: 8px;
}
.navbar-nav .nav-link,
.navbar-nav .dropdown-toggle {
  color: white !important;
}

/* ✅ 드롭다운 항목도 흰색 */

/* ✅ 드롭다운 hover 시 강조 색상 */
.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #4dabf7 !important;
}

/* ✅ active 상태 강조 */
.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover {
  color: #4dabf7 !important;
}