/* ===== GLOBAL ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #1e1e29;
  font-family: 'Montserrat', sans-serif;
  color: #fff;
  min-height: 100vh;
  position: relative;
}

/* ===== BACKGROUND BANNER ===== */
.background-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background: linear-gradient(to bottom, rgba(30, 30, 41, 0.3) 0%, rgba(30, 30, 41, 0.85) 100%),
    url('../img/banner.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  pointer-events: none;
}

.content-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== NAVBAR ===== */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(49, 49, 60, 0.92);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  padding: 0 30px;
  border-bottom: 1px solid rgba(78, 78, 87, 0.5);
  z-index: 100;
}
.nav-left {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}
.nav-left .logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  transition: 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-left .logo.discount {
  color: #a7d5ec;
}

/* Hamburger */
.hamburger {
  display: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #fff;
  padding: 0 6px;
  user-select: none;
  line-height: 1;
}

.nav-center {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex: 2;
}
.nav-center a {
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  transition: 0.3s;
}
.nav-center a:hover,
.nav-center a.active {
  background: rgba(167, 213, 236, 0.2);
  color: #a7d5ec;
}

.nav-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.nav-right .user-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: 0.2s;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.nav-right .user-wrapper:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(167, 213, 236, 0.2);
}
.nav-right .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #a7d5ec;
  object-fit: cover;
  flex-shrink: 0;
}
.nav-right .user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  min-width: 0;
}
.nav-right .user-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.nav-right .user-details {
  display: flex;
  gap: 6px;
  font-size: 0.65rem;
  color: #aaa;
  font-weight: 500;
  text-transform: uppercase;
}
.nav-right .user-details .rank {
  color: #a7d5ec;
  font-weight: 600;
}
.nav-right .user-details .platform {
  color: #888;
}
.nav-right .dropdown-icon {
  font-size: 0.8rem;
  color: #aaa;
  margin-left: 2px;
  transition: 0.2s;
}
.nav-right .user-wrapper:hover .dropdown-icon {
  color: #fff;
}

.nav-right .dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #2c2c3c;
  border-radius: 12px;
  padding: 6px 0;
  min-width: 160px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid #3a3a4e;
  z-index: 200;
}
.nav-right .dropdown-menu.show {
  display: block;
}
.nav-right .dropdown-menu button {
  background: none;
  border: none;
  color: #fff;
  padding: 10px 20px;
  width: 100%;
  text-align: left;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.2s;
  font-family: inherit;
}
.nav-right .dropdown-menu button:hover {
  background: #3a3a4e;
  color: #ff6666;
}

.login-nav-btn {
  color: #a7d5ec;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}
.login-nav-btn:hover {
  text-decoration: underline;
}

/* ===== SIDEBAR ===== */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  display: none;
}
.sidebar-overlay.active {
  display: block;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100%;
  background: #2c2c3c;
  z-index: 1000;
  transition: left 0.3s ease;
  padding: 20px 20px 30px;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0,0,0,0.5);
}
.sidebar.open {
  left: 0;
}

.sidebar-header {
  margin-bottom: 30px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-user .avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #a7d5ec;
  object-fit: cover;
}
.sidebar-user .user-info {
  display: flex;
  flex-direction: column;
}
.sidebar-user .user-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}
.sidebar-user .user-details {
  font-size: 0.8rem;
  color: #aaa;
}
.sidebar-user .user-details .rank {
  color: #a7d5ec;
}
.sidebar-user .user-details .platform {
  color: #888;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-menu li {
  margin: 12px 0;
}
.sidebar-menu a, .sidebar-menu button {
  display: block;
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: 0.2s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.sidebar-menu a:hover, .sidebar-menu button:hover {
  color: #a7d5ec;
  padding-left: 5px;
}
.sidebar-menu hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 10px 0;
}
.sidebar-menu button#sidebarLogoutBtn {
  color: #ff6666;
}
.sidebar-menu button#sidebarLogoutBtn:hover {
  color: #ff4444;
}
.sidebar-menu button#sidebarLoginBtn {
  color: #a7d5ec;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  max-width: 1200px;
  margin: 20px auto 40px;
  padding: 0 20px;
  flex: 1;
}

.filter-bar {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.filter-bar button {
  padding: 10px 35px;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.3s;
  background: rgba(58, 58, 78, 0.85);
  color: #fff;
  font-family: inherit;
  backdrop-filter: blur(5px);
}
.filter-bar button.active {
  background: #a7d5ec;
  color: #000;
}
.filter-bar button:hover {
  transform: scale(1.05);
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.product-card {
  background: rgba(44, 44, 60, 0.92);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 16px 14px 18px;
  width: 200px;
  text-align: center;
  transition: 0.3s;
  cursor: default;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.product-card img {
  max-width: 100%;
  border-radius: 12px;
  max-height: 120px;
  min-height: 100px;
  object-fit: contain;
  background: rgba(30, 30, 41, 0.5);
  padding: 6px;
  width: 100%;
  margin-bottom: 6px;
}

.product-card h3 {
  color: #fff;
  margin: 4px 0 2px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.product-card .badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.badge-coin {
  background: #2a6b3a;
  color: #88ff88;
}
.badge-rank {
  background: #6b4a2a;
  color: #ffcc66;
}

.product-card .price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #a7d5ec;
  margin: 4px 0 6px;
  min-height: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.product-card .price .original-price {
  text-decoration: line-through;
  color: #888;
  font-size: 0.75rem;
}
.product-card .price .final-price {
  color: #ff6b6b;
}
.product-card .price .upgrade-label {
  font-size: 0.55rem;
  color: #888;
}

.btn-group {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  padding-top: 6px;
  align-items: center;
}
.btn-group .buy-btn {
  flex: 1;
  background: #a7d5ec;
  color: #000;
  border: none;
  padding: 8px 12px;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s;
  font-family: inherit;
  font-size: 0.85rem;
  height: 36px;
  min-height: 36px;
}
.btn-group .buy-btn:hover:not(:disabled) {
  background: #6b948d;
  transform: scale(0.97);
}
.btn-group .buy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-group .info-btn {
  background: rgba(167, 213, 236, 0.12);
  border: 1px solid rgba(167, 213, 236, 0.2);
  color: #a7d5ec;
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 50px;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  padding: 0;
  font-family: inherit;
}
.btn-group .info-btn:hover {
  background: rgba(167, 213, 236, 0.25);
  border-color: rgba(167, 213, 236, 0.4);
  transform: scale(1.05);
}
.btn-group .info-btn i {
  pointer-events: none;
}

.empty-state {
  color: #ccc;
  text-align: center;
  padding: 60px 0;
  font-size: 1.1rem;
}

/* ===== CATEGORY HEADER ===== */
.category-header {
  width: 100%;
  font-size: 1.3rem;
  font-weight: 700;
  color: #a7d5ec;
  margin: 20px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(167, 213, 236, 0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.product-grid-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

/* ===== FOOTER ===== */
.footer {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 12px;
  padding: 25px 0;
  text-align: center;
  background: rgba(30, 30, 41, 0.6);
  backdrop-filter: blur(10px);
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.footer a {
  color: #a7d5ec;
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

/* ===== LOGIN MODAL ===== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}
.login-overlay.hidden {
  display: none;
}
.login-modal {
  background: #2c2c3c;
  border-radius: 28px;
  padding: 40px 35px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: slideUp 0.3s ease;
}
.login-modal h2 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
  letter-spacing: -0.5px;
}
.login-modal .subtitle {
  text-align: center;
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 28px;
}
.login-modal .form-group {
  margin-bottom: 18px;
}
.login-modal .form-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #a7d5ec;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}
.login-modal .platform-selector {
  display: flex;
  gap: 12px;
}
.login-modal .platform-selector label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 0;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: 0.2s;
}
.login-modal .platform-selector label:hover {
  background: rgba(255, 255, 255, 0.08);
}
.login-modal .platform-selector input[type="radio"] {
  accent-color: #a7d5ec;
  width: 15px;
  height: 15px;
  margin: 0;
}
.login-modal .platform-selector input[type="radio"]:checked+label {
  border-color: #a7d5ec;
  background: rgba(167, 213, 236, 0.08);
}
.login-modal input[type="text"] {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid #3a3a4e;
  background: #1e1e29;
  color: #fff;
  font-size: 0.95rem;
  transition: 0.2s;
  font-family: inherit;
}
.login-modal input[type="text"]:focus {
  outline: none;
  border-color: #a7d5ec;
  box-shadow: 0 0 0 3px rgba(167, 213, 236, 0.15);
}
.login-modal .btn-group {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.login-modal .btn-group button {
  flex: 1;
  padding: 14px 0;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.2s;
  font-family: inherit;
}
.login-modal .btn-login {
  background: #a7d5ec;
  color: #000;
}
.login-modal .btn-login:hover {
  background: #6b948d;
  transform: scale(0.97);
}
.login-modal .error-msg {
  color: #ff6666;
  font-size: 0.8rem;
  text-align: center;
  margin-top: 12px;
  min-height: 22px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }
  .nav-center a {
    display: none;
  }
  .nav-right .user-wrapper {
    display: none;
  }
  .nav-right .login-nav-btn {
    display: none;
  }
  nav {
    padding: 0 15px;
    height: 60px;
  }
  .nav-left {
    flex: 0 0 auto;
    gap: 8px;
  }
  .nav-left .logo {
    font-size: 0.9rem;
    flex-shrink: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    max-width: none;
  }
  .product-card {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
  .product-grid {
    gap: 12px;
  }
  .product-grid-inner {
    gap: 12px;
  }
  .filter-bar button {
    padding: 8px 20px;
    font-size: 0.8rem;
  }
  .category-header {
    font-size: 1.1rem;
    margin: 15px 0 8px 0;
  }
}

@media (max-width: 480px) {
  .login-modal {
    padding: 30px 20px 26px;
    margin: 0 15px;
  }
  .login-modal h2 {
    font-size: 1.3rem;
  }
  .login-modal .platform-selector label {
    font-size: 0.8rem;
    padding: 8px 0;
  }
  .product-card {
    max-width: 100%;
    width: 100%;
  }
}

/* ===== PERBAIKAN MODAL INFO RANK ===== */
.custom-swal {
  padding: 16px 16px 8px !important;
}
.custom-swal .swal2-title {
  margin-top: 0 !important;
  margin-bottom: 6px !important;
  font-size: 1.3rem !important;
}
.custom-swal .swal2-html-container {
  margin: 0 !important;
  padding: 0 !important;
  /* tidak ada max-height/overflow agar scroll hanya di dalam box deskripsi */
}
.custom-swal .swal2-actions {
  margin-top: 10px !important;
}

/* Tombol Tutup */
.custom-swal .swal2-confirm {
  background: #a7d5ec !important;
  color: #000 !important;
  font-weight: 700 !important;
  padding: 12px 60px !important;
  border-radius: 50px !important;
  border: none !important;
  font-size: 1rem !important;
  transition: 0.2s !important;
  width: auto !important;
  min-width: 120px !important;
}
.custom-swal .swal2-confirm:hover {
  background: #6b948d !important;
  transform: scale(0.97) !important;
}