/* static/css/style.css 전체 소스 */

/* 1. 폰트 및 기본 설정 */
:root {
    --gold: #ffc107;
    --dark-overlay: rgba(0, 0, 0, 0.75);
    --glass-bg: rgba(10, 10, 10, 0.65);
    --border-color: rgba(255, 255, 255, 0.15);
}

body {
    background-color: #000;
    font-family: 'Noto Sans KR', sans-serif;
    overflow-x: hidden;
}

/* 2. 배경 이미지 설정 */
.main-container {
    background-image: url('../images/bg_main.png');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    min-height: 100vh;
    width: 100%;
    padding-bottom: 100px;
}

/* 3. 유틸리티 */
.text-gold { color: var(--gold) !important; }
.fw-black { font-weight: 900 !important; }

/* 4. 네비게이션 바 (50px 슬림 고정) */
.navbar {
    padding: 0 !important;
    height: 50px !important;
    min-height: 50px !important;
    transition: all 0.3s ease;
}

/* 5. 로고 설정 */
.logo-enlarged {
    max-height: 40px !important; /* 50px 바에 맞게 조정 */
    width: auto;
    object-fit: contain;
}

/* 6. 메뉴 글씨 수직 중앙 정렬 */
.navbar-nav .nav-link {
    font-size: 1rem;
    line-height: 50px; /* 높이 50px에 맞춤 */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    transition: color 0.3s;
}
.navbar-nav .nav-link:hover {
    color: var(--gold) !important;
}

/* 7. 헤더 아이콘 영역 */
.header-icons {
    height: 50px;
    display: flex;
    align-items: center;
}

/* 8. 검색창 아이콘 */
.search-bar-wrapper i.fa-search.text-gold { opacity: 0.8; }

/* 9. 유리 질감 패널 */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* 10. 거래내역 리스트 */
.transaction-list .d-flex {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* 11. 비디오 썸네일 */
.video-thumbnail i {
    text-shadow: 0 0 20px rgba(0,0,0,0.8);
    cursor: pointer;
    transition: transform 0.3s;
}
.video-thumbnail i:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

/* 12. 버튼 스타일 */
.btn-warning {
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    transition: all 0.3s;
}
.btn-warning:hover {
    background-color: #ffdb4d !important;
    box-shadow: 0 0 30px rgba(255, 193, 7, 0.6);
}

/* 13. [핵심] 드롭다운 메뉴 스타일 (수정됨) */
.user-menu-dropdown {
    position: absolute;
    top: 50px; /* 네비게이션 높이(50px)만큼 띄움 */
    right: 0;
    width: 200px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gold);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    overflow: hidden;
    z-index: 9999;
    
    /* 평소에는 완벽하게 숨김 */
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* 클릭해서 'show' 클래스가 붙었을 때만 보임 */
.user-menu-dropdown.show {
    max-height: 300px;
    opacity: 1;
    visibility: visible;
    padding-bottom: 10px;
}

.dropdown-item-custom {
    display: block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-item-custom:hover {
    background: rgba(255, 193, 7, 0.2);
    color: var(--gold);
}

/* 14. 로그인/회원가입 폼 스타일 */
.auth-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
}

.custom-form input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    padding: 12px;
    border-radius: 5px;
    width: 100%;
    margin-bottom: 15px;
}

.custom-form input:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--gold) !important;
    outline: none;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}

.custom-form label {
    color: #bbb;
    margin-bottom: 5px;
    display: block;
    font-size: 0.9rem;
}

.custom-form .helptext { display: none; }

/* 회원가입 폼: select(은행)도 input과 동일한 테마 적용 */
.custom-form select.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  outline: none;

  /* 기본 select UI 제거(브라우저마다 다름) */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* 화살표 공간 */
  padding-right: 42px;

  /* 커서 */
  cursor: pointer;
}

/* 드롭다운 옵션 배경/글자색 (이거 안 하면 옵션이 하얀 배경+흰 글자 되는 경우 있음) */
.custom-form select.form-control option {
  background: #1a1a1a;
  color: #fff;
}

/* 커스텀 화살표(테마에 맞게 은은하게) */
.custom-form select.form-control {
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.65) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.65) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 52%,
    calc(100% - 16px) 52%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* 포커스 스타일도 input과 통일 */
.custom-form select.form-control:focus {
  border-color: rgba(212, 175, 55, 0.6); /* gold 계열 */
  box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.15);
}
/* =========================
   MOBILE FIRST PATCH
   ========================= */

/* 부트스트랩 토글 버튼이 어두운 배경에서 안 보일 수 있어서 */
.navbar .navbar-toggler {
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 10px;
  border-radius: 10px;
}
.navbar .navbar-toggler:focus {
  box-shadow: none;
}
.navbar .navbar-toggler-icon {
  filter: invert(1);
  opacity: 0.9;
}

/* 모바일에서 fixed + 배경 attachment fixed는 성능/깨짐 이슈가 많음 */
@media (max-width: 991.98px) {
  /* 상단바: 높이 축소 */
  .navbar {
    height: 64px !important;
    min-height: 64px !important;
    padding: 0 8px !important;
  }

  /* main 패딩도 네비 높이에 맞춰 축소 */
  main {
    padding-top: 64px !important;
  }

  /* 로고 크기 다운 */
  .navbar-brand img {
    height: 36px !important;
  }

  /* 가운데 메뉴: 모바일에서는 collapse 안에서 세로 리스트로 */
  #mainNavbar {
    background: rgba(0,0,0,0.92);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 10px 8px 14px 8px;
    border-radius: 0 0 14px 14px;
    backdrop-filter: blur(12px);
  }

  .navbar-nav {
    gap: 0 !important;
  }

  .navbar-nav .nav-item {
    height: auto !important;
  }

  .navbar-nav .nav-link {
    line-height: normal !important;      /* 데스크톱 50px 강제 해제 */
    padding: 12px 12px !important;
    border-radius: 12px;
    font-size: 1.02rem !important;
  }

  .navbar-nav .nav-link:hover {
    background: rgba(255,255,255,0.06);
  }

  /* 우측 아이콘 영역: 터치 영역 확보 + 너무 오른쪽 붙는 것 방지 */
  .navbar .me-4 {
    margin-right: 8px !important;
  }

  #userIconBtn {
    padding: 10px 12px !important;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
  }

  /* 벨/새로고침 아이콘도 터치하기 편하게 */
  .navbar i.fas.fa-bell,
  .navbar i.fas.fa-sync-alt {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
  }

  /* 가운데 구분선(vr)은 모바일에서 지저분해 보여서 숨김 */
  .navbar .vr {
    display: none !important;
  }

  /* 드롭다운 위치: 모바일 네비 높이에 맞춤 */
  .user-menu-dropdown {
    top: 64px !important;
    right: 8px !important;
    width: min(240px, calc(100vw - 16px)) !important;
    border-radius: 14px;
  }

  /* 메인 배경: 모바일에서는 fixed 제거 */
  .main-container {
    background-attachment: scroll !important;
    padding-bottom: 70px;
  }

  /* 폼/패널: 모바일에서 여백/폭 최적화 */
  .glass-panel {
    border-radius: 16px;
  }

  .auth-container {
    max-width: 100% !important;
    margin: 22px 14px !important;
    padding: 22px 16px !important;
  }

  .custom-form input,
  .custom-form select.form-control {
    padding: 12px 12px !important;
    border-radius: 12px !important;
    font-size: 16px !important; /* iOS 자동 확대(zoom) 방지 */
  }

  /* 푸터: 모바일에서 과한 패딩 줄이기 */
  .footer {
    padding: 30px 0 20px 0;
  }
  .footer-info-item,
  .copyright {
    font-size: 0.85rem;
  }
}

/* 아주 작은 화면(아이폰 mini급) 추가 압축 */
@media (max-width: 375px) {
  .navbar {
    height: 60px !important;
    min-height: 60px !important;
  }
  main {
    padding-top: 60px !important;
  }
  .user-menu-dropdown {
    top: 60px !important;
  }
}
