/* Ex-TopUp Mobile CSS (Mobile-First Layout) */

:root {
  --primary: #DF232B;
  /* Red Accent */
  --primary-dark: #b81920;
  --primary-light: #ffeaeb;
  --bg-gradient: linear-gradient(135deg, #fff3f3 0%, #ffffff 50%, #ffebeb 100%);
  --card-bg: rgba(255, 255, 255, 0.9);
  --text-dark: #333333;
  --text-light: #777777;
  --border-color: #eeeeee;
  --whatsapp-bg: #efeae2;
  --chat-bubble-user: #d9fdd3;
  --chat-bubble-admin: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', 'Inter', sans-serif;
  -webkit-tap-highlight-color: transparent;
  /* Disable tap highlight for no-hover feel */
}

body {
  overscroll-behavior-y: none;
}

body {
  background: var(--bg-gradient);
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.5;
  padding-bottom: 70px;
  /* Space for fixed bottom navbar */
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Header */
header {
  position: sticky;
  top: 0;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 900;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-section img {
  height: 32px;
  width: auto;
}

.logo-section h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mail-icon-btn {
  position: relative;
  font-size: 20px;
  color: var(--text-dark);
  background: none;
  border: none;
  cursor: pointer;
}

.mail-unread-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  background-color: #2ec15d;
  /* Green dot */
  border-radius: 50%;
  border: 1.5px solid #ffffff;
}

.wallet-badge {
  background: var(--primary-light);
  border: 1px solid rgba(223, 35, 43, 0.15);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Fixed Bottom Nav Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.04);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-light);
  font-size: 10px;
  font-weight: 600;
  width: 20%;
  height: 100%;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.bottom-nav-item i {
  font-size: 18px;
}

.bottom-nav-item.active {
  color: var(--primary);
}

/* Container */
.container {
  padding: 16px;
  width: 100%;
}

/* Announcement Ticker */
.ticker-container {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01);
}

.ticker-title {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.ticker-text-wrapper {
  overflow: hidden;
  flex: 1;
}

.ticker-text {
  display: inline-block;
  white-space: nowrap;
  animation: ticker 15s linear infinite;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-dark);
}

@keyframes ticker {
  0% {
    transform: translate3d(100%, 0, 0);
  }

  100% {
    transform: translate3d(-100%, 0, 0);
  }
}

/* Slider Carousel */
.slider-container {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.slider-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease-in-out;
}

.slide {
  min-width: 100%;
  height: 100%;
  position: relative;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 12px;
  color: #ffffff;
}

.slide-caption h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.slide-caption p {
  font-size: 11px;
  opacity: 0.8;
}

.slider-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.slider-dot {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: 0.3s;
}

.slider-dot.active {
  background: #ffffff;
  width: 16px;
  border-radius: 3px;
}

/* Sectors Grid */
.section-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-dark);
  border-left: 4px solid var(--primary);
  padding-left: 8px;
}

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.sector-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease;
  height: 180px;
}

.sector-card:active {
  transform: scale(0.98);
}

.sector-img {
  width: 100%;
  height: 70%;
  object-fit: cover;
  display: block;
}

.sector-info {
  padding: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex: 1;
}

.sector-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dark);
}

/* Topup Purchase Layout */
.topup-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topup-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.01);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
}

.form-input {
  width: 100%;
  height: 48px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
}

/* Packages Grid (2 per row on phone) */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.package-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.package-card.selected {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.package-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 2px;
}

.package-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
}

/* Payment Methods Grid */
.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.payment-method-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.payment-method-card.selected {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.payment-method-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.payment-method-info {
  display: flex;
  flex-direction: column;
}

.payment-method-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dark);
}

.payment-method-subtitle {
  font-size: 9px;
  color: var(--text-light);
}

.warning-box {
  background-color: #fff9db;
  border: 1px solid #ffe066;
  border-radius: 8px;
  padding: 12px;
  color: #8f6b00;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  width: 100%;
  height: 48px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(223, 35, 43, 0.2);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Rules Section */
.rules-container {
  font-size: 12px;
  color: var(--text-light);
}

.rules-container ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Add Money UI */
.payment-step {
  display: none;
}

.payment-step.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.readonly-input-group {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  height: 48px;
}

.readonly-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
}

.copy-btn {
  background: #eaeaea;
  border: none;
  height: 100%;
  width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  cursor: pointer;
}

.copy-btn:active {
  background: #dddddd;
}

.file-upload-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px dashed #cccccc;
  border-radius: 8px;
  height: 48px;
  padding: 0 16px;
  cursor: pointer;
}

.file-upload-wrapper input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-content {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
  font-weight: 600;
  font-size: 13px;
}

.file-upload-content i {
  font-size: 18px;
}

/* TopUp History */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.01);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 8px;
}

.order-id {
  font-weight: 700;
  color: var(--text-dark);
}

.order-status {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

.status-pending {
  background-color: #fff4e6;
  color: #fd7e14;
}

.status-completed {
  background-color: #ebfbee;
  color: #0ca678;
}

.status-rejected {
  background-color: #fff5f5;
  color: #fa5252;
}

.order-card-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  font-size: 12px;
}

.order-detail-label {
  color: var(--text-light);
  font-weight: 500;
}

.order-detail-value {
  color: var(--text-dark);
  font-weight: 700;
  text-align: right;
}

/* Profile UI */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--primary), #ff6b70);
  border-radius: 16px;
  padding: 20px;
  border: none;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px rgba(223, 35, 43, 0.3);
  color: white;
  position: relative;
  overflow: hidden;
}

.profile-header::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.5);
  z-index: 1;
}

.profile-user-info {
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.profile-name {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.profile-role {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
}

.profile-stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-box-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-box-label {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 4px;
}

.stat-box-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.profile-details-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-detail-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  border-bottom: 1px solid #f9f9f9;
  padding-bottom: 8px;
}

.profile-detail-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.support-buttons-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.btn-whatsapp {
  background-color: #25d366;
  color: #fff;
}

.btn-telegram {
  background-color: #0088cc;
  color: #fff;
}

/* WhatsApp-like Chat Support Page */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 130px);
  /* Fill space between header and bottom nav */
  background-color: var(--whatsapp-bg);
  /* Classic WhatsApp tiled/box pattern background using css */
  background-image: radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 0),
    radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 0);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.chat-header {
  background-color: #075e54;
  /* WhatsApp Green */
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-avatar {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.chat-header-title {
  font-size: 13px;
  font-weight: 700;
}

.chat-header-links {
  display: flex;
  gap: 12px;
}

.chat-header-link {
  color: #ffffff;
  font-size: 18px;
  text-decoration: none;
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-bubble {
  max-width: 75%;
  padding: 8px 12px 16px 12px;
  border-radius: 8px;
  font-size: 13px;
  position: relative;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.message-bubble.user {
  background-color: var(--chat-bubble-user);
  align-self: flex-end;
  border-top-right-radius: 0;
}

.message-bubble.admin {
  background-color: var(--chat-bubble-admin);
  align-self: flex-start;
  border-top-left-radius: 0;
}

.message-time {
  position: absolute;
  bottom: 2px;
  right: 6px;
  font-size: 9px;
  color: var(--text-light);
}

.chat-input-area {
  background-color: #f0f0f0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-input {
  flex: 1;
  height: 38px;
  background: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 0 16px;
  outline: none;
  font-size: 13px;
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  background-color: #075e54;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-send-btn:active {
  background-color: #128c7e;
}

/* Modals & Popups */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1100;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-light);
  cursor: pointer;
}

/* Inbox Mail Items */
.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 4px;
}

.inbox-item {
  border: 1px solid var(--border-color);
  background: #fcfcfc;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inbox-item.unread {
  border-left: 4px solid #2ec15d;
  background: #ffffff;
  font-weight: 600;
}

.inbox-title {
  color: #b58900;
  /* Yellow / Gold Title */
  font-size: 13px;
  font-weight: 700;
}

.inbox-snippet {
  font-size: 12px;
  color: var(--text-light);
}

.inbox-time {
  font-size: 9px;
  color: var(--text-light);
  align-self: flex-end;
}

.mail-detail-img {
  width: 100%;
  border-radius: 8px;
  margin-top: 8px;
  max-height: 180px;
  object-fit: cover;
}

/* Views Management */
.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

/* Custom Alert Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.custom-alert-content {
  background: #ffffff;
  width: 100%;
  max-width: 320px;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.custom-alert-icon {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 12px;
}

.custom-alert-msg {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.custom-alert-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.custom-alert-actions button {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.custom-alert-actions button:active {
  opacity: 0.8;
}

.custom-alert-actions .btn-alert-ok {
  background: var(--primary);
  color: #fff;
}

.custom-alert-actions .btn-alert-cancel {
  background: #f1f1f1;
  color: var(--text-dark);
}