/* KRONA Stake Style Integration */
:root {
  --primary-gold: #D4AF37;
  --dark-bg: #0f172a;
  --card-bg: #1e293b;
  --text-gray: #94a3b8;
  --krona-cyan: #00f2fe;
  --glass-bg: rgba(30, 41, 59, 0.35);  
  --sidebar-width: 250px;
}

body {
  background-color: var(--dark-bg);
  color: white;
  font-family: 'Inter', sans-serif;

  /* background-image: radial-gradient(circle at 50% 0%, #2a2a35 0%, #0f172a 70%); */
  background-attachment: fixed;
  background-size: cover;
  
  /* height 대신 min-height 사용 */
  min-height: 100vh; 
  /* 모바일 브라우저 주소창 대응 (Dynamic Viewport Height) */
  min-height: 100dvh; 

  /* display: flex;
  align-items: center;
  justify-content: center; */
  display: block !important;

  /* 중요: 전체 스크롤을 막는 대신 가로만 막고 세로는 상황에 따라 허용 */
  overflow-x: hidden; 
  overflow-y: auto; 
  
  padding-bottom: 80px; /* 하단 버튼 가림 방지 여백 */

  /* 5. 아이폰 노치/하단 바 대응 (Safe Area) */
  /* 아이폰 밑에 있는 홈 바(Home Indicator)에 버튼이 가려지는 것 방지 */
  padding-bottom: env(safe-area-inset-bottom);
}

/* (선택사항) 모바일에서 스크롤바 숨기기 (기능은 유지하되 디자인만 깔끔하게) */
body::-webkit-scrollbar {
  display: none; /* 크롬, 사파리 등 */
}

body {
  -ms-overflow-style: none;  /* IE, Edge */
  scrollbar-width: none;  /* 파이어폭스 */
}

/* 2. [NEW] 로그인/회원가입 전용 중앙 정렬 래퍼 */
.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  
  /* 화면 전체 높이를 차지해야 정중앙에 옵니다 */
  min-height: 100vh; 
  min-height: 100dvh; /* 모바일 브라우저 대응 */
  
  width: 100%;
  padding: 20px; /* 모바일에서 좌우 여백 확보 */
  
  /* (선택) 배경이 필요하다면 여기에 그라데이션 추가 */
  /* background: radial-gradient(...); */
}

.gold-ticker {
  background: linear-gradient(90deg, #1e293b, #000);
  border-bottom: 1px solid #334155;
 
  font-weight: 600;
  padding: 8px 0;
  font-size: 0.9rem;
  margin-top: 0 !important;
  border-top-left-radius: 0 !important; /* 상단이 둥글면 떠 보일 수 있음 */
  border-top-right-radius: 0 !important;
}

.text-gold{
  color: var(--primary-gold);
}

/* 유리 질감 카드 (Glassmorphism) */
.glass-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);

  /* ★ 핵심: 고정 너비(460px) 대신 부모 그리드에 맞춤 */
  width: 100% !important; 
  height: 100%; /* 옆 카드와 높이 맞추기 위해 */
  
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 호버 효과 (살짝 뜸) */
.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

/* 1. 사이드바 (Slower Motion) */
#sidebar {
  width: var(--sidebar-width);
  /* margin-left:  var(--sidebar-width); 기본은 숨김 (모바일 우선 정책) */
  height: 100vh;
  position: fixed;  
  z-index: 1050 !important; /* SweetAlert 기본값(1060)보다 낮아야 함 */
  top: 0;
  left: 0;
  
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  
  display: flex;
  flex-direction: column;

  /* 속도 조절: 0.6초, 부드러운 감속 */
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}


.sidebar-heading { 
  padding: 2rem 1rem; 
  text-align: center; 
  /* border-bottom: 1px solid rgba(255,255,255,0.1); */
}

/* 메뉴 링크 스타일 */
.sidenav-link {
  color: rgba(255,255,255,0.6); 
  padding: 18px 25px; 
  font-size: 16px;
  display: flex; 
  align-items: center; 
  transition: all 0.3s; 
  text-decoration: none;
  border-left: 4px solid transparent; /* 호버 효과 준비 */
}

.sidenav-link i { 
  width: 25px; 
  text-align: center; 
  margin-right: 15px; 
}

/* 활성화(Active) 및 호버 스타일 */
.sidenav-link:hover, .sidenav-link.active {
  color: #fff; 
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, transparent 100%); /* Gold Tint */
  border-left-color: var(--primary-gold); 
}

.btn-close-sidebar {
  position: absolute;
  top: 15px;      /* 위에서 15px */
  right: 15px;    /* 오른쪽에서 15px */
  
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5); /* 은은한 회색 */
  font-size: 1.5rem; /* 아이콘 크기 키움 */
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  padding: 5px; /* 터치 영역 확보 */
}

/* 호버하거나 눌렀을 때 */
.btn-close-sidebar:hover,
.btn-close-sidebar:active {
  color: #fff;       /* 흰색으로 밝게 */
  transform: rotate(90deg); /* 뱅글 도는 애니메이션 (재미 요소) */
}

/* 2. 오버레이 (배경 어둡게) */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.6s ease;
}

body.sidebar-open #overlay {
  opacity: 1;
  visibility: visible;
  
  /* ★ 중요: 이때만 클릭 가능하게 변경 */
  pointer-events: auto; 
  cursor: pointer; /* 손가락 모양 커서 (클릭 가능하다는 힌트) */
}

/* 3. 메인 컨텐츠 영역 (PC에서 밀림 효과) */
#page-content-wrapper {
  transition: margin-left 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  width: 100%;
  min-height: 100vh;
  padding: 0;
  padding-top: 0 !important;
  margin-top: 0 !important;
  /* position: relative; */
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 1.2rem;
  position: relative;
}

label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
  display: block;
  margin-left: 5px;
}

/* 입력창: Login 페이지 스타일 (custom-input-group 느낌) */
.form-control, input[type="text"], input[type="email"], input[type="password"] {
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: #fff !important;
  height: 48px;
  border-radius: 12px;
  font-size: 15px;
  width: 100%;
  padding: 10px 15px;
  display: block;
  transition: all 0.3s ease;
}

.form-control:focus, input:focus {
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3) !important;
  background: rgba(0, 0, 0, 0.4) !important;
  outline: none;
}

/* 입력 필드 스타일링 */
.custom-input-group {
  position: relative;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.custom-input-group:focus-within {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.custom-input-group .form-control-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 16px;
  z-index: 10;
}

.custom-input-group input {
  background: transparent !important;
  border: none !important;
  color: #fff !important;
  padding: 15px 15px 15px 45px; /* 아이콘 공간 확보 */
  height: auto;
  font-size: 15px;
  width: 100%;
  border-radius: 12px;
}

.custom-input-group input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.custom-input-group input:focus {
  box-shadow: none;
  background: transparent;
}

/* 어두운 테마에서의 입력창 스타일 */
.form-control-dark {
  background-color: rgba(0, 0, 0, 0.4) !important; /* 더 어둡게 눌러주거나 */
  border: 1px solid rgba(255, 255, 255, 0.15) !important; /* 테두리를 조금 더 선명하게 */
  color: #fff !important;
}

.form-control-dark:focus {
  background-color: rgba(0, 0, 0, 0.6) !important;
  border-color: var(--primary-gold) !important; /* 포커스 시 골드 테두리 */
  box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25);
}
/* 버튼 스타일 (그라데이션) */
.btn-krona {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); /* 예시: 청록 계열 */
  /* 만약 Stake 페이지가 보라색 계열이라면 아래 주석을 해제해서 쓰세요 */
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  
  border: none;
  color: #000;
  font-weight: 700;
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  letter-spacing: 0.5px;
  width: 100%;
  transition: all 0.3s ease;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
  /* cursor: pointer; */
}

.btn-krona:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
  color: #000;
}

.btn-secondary-krona {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  padding: 12px;
  font-size: 13px;
  border-radius: 12px;
  width: 100%;
  margin-top: 10px;
  transition: all 0.3s;
}
.btn-secondary-krona:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #fff;
  color: #fff;
}

.btn-gold {
  background: linear-gradient(135deg, #D4AF37 0%, #AA8A2E 100%);
  border: none; color: black; font-weight: 800; transition: all 0.3s ease;
}
.btn-gold:hover {
  transform: translateY(-2px); box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4); color: black;
}
.btn-outline-gold {
  border: 1px solid var(--primary-gold); color: var(--primary-gold); background: transparent;
}
.btn-outline-gold:hover {
  background: var(--primary-gold); color: black;
}

/* --- Progress Bar --- */
.progress-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  position: relative;
  padding: 0 20px;
}

.progress-line-bg {
  position: absolute;
  top: 50%;
  left: 30px;
  right: 30px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.progress-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  z-index: 2;
  transition: all 0.3s;
}

/* 활성화된 스텝: Cyan 테마 적용 */
.progress-step.active {
  background: #00f2fe; /* 버튼 색상 중 하나 */
  color: #000;
  border-color: #00f2fe;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.signup-step {
  display: none;
  /* 애니메이션 효과 */
  animation: fadeInUp 0.5s; 
}
.signup-step.active {
  display: block;
}

/* --- Validation & Info --- */
.error-message {
  color: #ff6b6b;
  font-size: 12px;
  margin-top: 5px;
  padding-left: 5px;
}

.timer {
  position: absolute;
  right: 15px;
  top: 40px; /* label 고려 */
  color: #00f2fe; /* 타이머도 Cyan */
  font-size: 13px;
  font-weight: bold;
}

.info-box {
  background: rgba(79, 172, 254, 0.1); /* 푸른빛이 도는 박스 */
  border-radius: 12px;
  padding: 15px;
  margin-top: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(79, 172, 254, 0.3);
}

/* --- Modal (Glass style) --- */
.modal {
  display: none; 
  position: fixed; 
  z-index: 9999; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  background-color: rgba(0,0,0,0.7); 
  backdrop-filter: blur(8px); /* 배경 더 흐리게 */
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: auto;
  padding: 40px 30px;
  width: 90%;
  max-width: 400px;
  border-radius: 24px;
  text-align: center;
  color: #fff;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* 링크 텍스트 */
.link-sub {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.3s;
}
.link-sub:hover {
  color: #fff;
}

/* 로고 영역 */
.logo-container {
  margin-bottom: 30px;
  position: relative;
}

/* 배경 장식용 빛 (선택 사항) */
.glow-effect {
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(79, 172, 254, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
}

/* 애니메이션 */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}


/* [PC/태블릿] 화면이 넓을 때는 카드의 너비를 픽셀 단위로 '강제 고정' 합니다 */
@media (min-width: 768px) {
  .glass-card {
      /* 내용물이 적든 많든 무조건 460px로 고정 (원하는 크기로 조절 가능) */
      width: 460px !important; 
      
      /* 혹시 모를 레이아웃 꼬임 방지 */
      min-width: 460px !important;
      margin: 0 auto; /* 중앙 정렬 확실하게 */
  }
}

/* [모바일] 화면이 좁을 때는 꽉 차게 (기존 유지) */
@media (max-width: 767px) {
  .glass-card {
      width: 100% !important;
      min-width: 0 !important;
  }
}

/* [모바일: 992px 미만] - 사이드바 숨김, 하단 버튼 보임 */
@media (max-width: 991.98px) {
    
  /* 사이드바 숨김 (왼쪽으로 보냄) */
  #sidebar {
      transform: translateX(-100%);
  }

  /* 컨텐츠는 꽉 차게 */
  #page-content-wrapper {
      margin-left: 0 !important;
      width: 100% !important;
  }

  /* 햄버거 버튼 눌러서 열렸을 때 (JS가 body에 sidebar-open 클래스 줄 때) */
  body.sidebar-open #sidebar {
      transform: translateX(0); /* 튀어나옴 */
  }

  /* 하단 버튼 보임 */
  #bottom-menu-toggle { display: flex !important; }
}

/* ============================================================
 [PC: 992px 이상]
 ============================================================ */
@media (min-width: 992px) {
  
  /* 1. 사이드바: 항상 보임 & 제자리 찾기 */
  #sidebar {
      transform: translateX(0) !important;
      left: 0 !important;
      /* 혹시나 width가 지정 안 되어 있을까봐 안전장치 */
      width: 250px !important; 
  }

  /* 2. 오버레이 & 하단 버튼: 숨김 */
  #overlay, 
  #bottom-menu-toggle { 
      display: none !important; 
  }

  /* 3. ★ [핵심 해결] 컨텐츠 영역 계산 */
  #page-content-wrapper {
      /* 왼쪽을 사이드바 너비만큼 밉니다 */
      margin-left: 250px !important; 
      
      /* ★ [중요] 전체 폭에서 250px를 뺀 만큼만 차지해라! */
      /* 이걸 안 하면 오른쪽으로 250px만큼 튀어나갑니다. */
      width: calc(100% - 250px) !important; 
  }
}

/* --- 5. 하단 투명 플로팅 버튼 (New!) --- */
#bottom-menu-toggle {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%); /* 중앙 정렬 */
  z-index: 1030;
  
  /* 투명도 높임 (컨텐츠가 비쳐 보이도록) */
  background: rgba(15, 23, 42, 0.4); 
  backdrop-filter: blur(4px); /* 뒤에 글씨가 살짝 흐리게 비침 */
  -webkit-backdrop-filter: blur(4px);
  
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px; /* 알약 모양 */
  padding: 10px 25px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* 스크롤 유도를 위한 미세한 움직임 */
#bottom-menu-toggle:active {
  transform: translateX(-50%) scale(0.95);
  background: rgba(15, 23, 42, 0.6);
}

/* 텍스트 & 아이콘 스타일 */
.toggle-text {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.toggle-icon {
  color: var(--krona-cyan);
  font-size: 18px;
}

/* [Referral Modal Styles] */

.btn-social {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.btn-social:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  color: white;
}

/* 브랜드별 색상 */
.telegram { background: #0088cc; } /* 텔레그램 파랑 */
.twitter  { background: #1DA1F2; } /* 트위터 하늘 */
.whatsapp { background: #25D366; } /* 왓츠앱 초록 */

/* 인풋창 포커스 시 효과 */
.referral-popup input:focus {
  box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25);
  border-color: var(--primary-gold);
}

