/* ==========================================
   1. GLOBAL RESET & BYBIT-STYLE TYPOGRAPHY
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: #f8f9fc;
  color: #121417;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.dark-theme {
  background-color: #0b0f17;
  color: #f1f5f9;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ==========================================
   2. DESKTOP LAYOUT & SIDEBAR
   ========================================== */
.app-layout {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background-color: #ffffff;
  border-right: 1px solid #e6e8ea;
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}

body.dark-theme .sidebar {
  background-color: #111827;
  border-right-color: #1f293d;
}

.brand-logo {
  font-size: 18px;
  font-weight: 700;
  color: #000033;
  padding-left: 10px;
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}

body.dark-theme .brand-logo {
  color: #3b82f6;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #707a8a;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

body.dark-theme .nav-links a {
  color: #94a3b8;
}

.nav-links a:hover,
.nav-links a.active {
  background-color: #f0f4fd;
  color: #000033;
  font-weight: 600;
}

body.dark-theme .nav-links a:hover,
body.dark-theme .nav-links a.active {
  background-color: #1e293b;
  color: #3b82f6;
}

.main-wrapper {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - 240px);
}

.page-content {
  padding: 20px 24px;
  flex: 1;
  background-color: #ffffff;
  margin: 20px 32px;
  border-radius: 12px;
  border: 1px solid #e6e8ea;
}

body.dark-theme .page-content {
  background-color: #111827;
  border-color: #1f293d;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ==========================================
   3. PAGE CONTAINER & HEADER
   ========================================== */
.giftcard-page-container {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: #000033;
  letter-spacing: -0.2px;
}

body.dark-theme .page-title {
  color: #f8fafc;
}

.page-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

body.dark-theme .page-subtitle {
  color: #94a3b8;
}

.icon-btn {
  background: rgba(0, 0, 51, 0.05);
  border: 1px solid #e2e8f0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  color: #000033;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.dark-theme .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

/* ==========================================
   4. GIFTCARD SELECTION GRID
   ========================================== */
.section-block {
  margin-bottom: 24px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: #121417;
  margin-bottom: 12px;
  letter-spacing: -0.1px;
  text-transform: uppercase;
}

body.dark-theme .section-title {
  color: #f8fafc;
}

.giftcard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.giftcard-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
}

body.dark-theme .giftcard-card {
  background-color: #161f2e;
  border-color: #233148;
}

.giftcard-card:hover,
.giftcard-card.active {
  border-color: #000033;
  box-shadow: 0 4px 12px rgba(0, 0, 51, 0.06);
}

body.dark-theme .giftcard-card:hover,
body.dark-theme .giftcard-card.active {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.card-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #ffffff;
}

.apple-bg { background-color: #000000; }
.amazon-bg { background-color: #ff9900; }
.steam-bg { background-color: #171a21; }
.google-bg { background-color: #01875f; }
.ebay-bg { background-color: #e53238; }
.sephora-bg { background-color: #e11d48; }

.card-info {
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 12px;
  font-weight: 600;
  color: #121417;
}

body.dark-theme .card-title {
  color: #f8fafc;
}

.card-rate {
  font-size: 11px;
  color: #10b981;
  font-weight: 700;
  margin-top: 2px;
}

.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 6px;
  background-color: #e2e8f0;
  color: #64748b;
  font-weight: 600;
}

body.dark-theme .badge {
  background-color: #1e293b;
  color: #94a3b8;
}

.badge.high-rate {
  background-color: #d1fae5;
  color: #065f46;
}

body.dark-theme .badge.high-rate {
  background-color: #064e3b;
  color: #6ee7b7;
}

/* ==========================================
   5. REDEMPTION FORM & UPLOAD AREA
   ========================================== */
.redemption-form {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.dark-theme .redemption-form {
  background-color: #161f2e;
  border-color: #233148;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

body.dark-theme .form-label {
  color: #94a3b8;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  font-size: 13px;
  color: #121417;
  outline: none;
  transition: border-color 0.15s ease;
}

body.dark-theme .form-control {
  background-color: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.form-control:focus {
  border-color: #000033;
}

body.dark-theme .form-control:focus {
  border-color: #3b82f6;
}

.pin-input {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 600;
  letter-spacing: 1px;
}

.payout-calculator {
  background-color: #f0f4fd;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #e2e8f0;
}

body.dark-theme .payout-calculator {
  background-color: #1e293b;
  border-color: #334155;
}

.payout-label {
  font-size: 12px;
  font-weight: 600;
  color: #000033;
}

body.dark-theme .payout-label {
  color: #94a3b8;
}

.payout-amount {
  font-size: 16px;
  font-weight: 700;
  color: #10b981;
}

/* Custom File Upload Box */
.file-upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background-color: #ffffff;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease;
}

body.dark-theme .file-upload-area {
  background-color: #0f172a;
  border-color: #334155;
}

.file-upload-area:hover {
  border-color: #000033;
}

body.dark-theme .file-upload-area:hover {
  border-color: #3b82f6;
}

.upload-icon {
  font-size: 24px;
  color: #64748b;
}

.upload-text {
  font-size: 12px;
  font-weight: 600;
  color: #121417;
}

body.dark-theme .upload-text {
  color: #f8fafc;
}

.upload-hint {
  font-size: 10px;
  color: #94a3b8;
}

.file-input {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

.submit-btn {
  background-color: #000033;
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
  margin-top: 4px;
}

body.dark-theme .submit-btn {
  background-color: #2563eb;
}

.submit-btn:hover {
  opacity: 0.9;
}

/* ==========================================
   6. FOOTER & FLOATING MOBILE NAVIGATION
   ========================================== */
.desktop-footer {
  padding: 16px 32px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
}

.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  .page-content {
    margin: 12px;
    padding: 16px 12px;
  }

  .giftcard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* FLOATING MOBILE NAVIGATION BAR */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 16px;
    left: 5%;
    width: 90%;
    background-color: #000033;
    border-radius: 30px;
    justify-content: space-around;
    align-items: center;
    padding: 8px 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 200;
  }

  body.dark-theme .mobile-nav {
    background-color: #1e293b;
    border: 1px solid #334155;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.65);
  }

  body.dark-theme .mobile-nav-item {
    color: #64748b;
  }

  .mobile-nav-item i {
    font-size: 15px;
  }

  .mobile-nav-item.active {
    color: #ffffff;
    font-weight: 600;
  }

  body.dark-theme .mobile-nav-item.active {
    color: #60a5fa;
  }

  .desktop-footer {
    padding-bottom: 80px;
  }
}