/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(to right, #0f2027, #203a43, #2c5364);
  color: #f0f0f0;
  min-height: 100vh;
}

nav {
  background-color: #121b23;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.nav-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #00d2ff;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links button {
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 5px;
}

.nav-links button:hover, .nav-links button:focus {
  background-color: #00d2ff;
  color: #000;
  outline: 2px solid #00a2cc;
}

.container {
  background: rgba(255, 255, 255, 0.05);
  margin: 2rem auto;
  max-width: 600px;
  padding: 2rem;
  border-radius: 10px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

h2 {
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  color: #ffffff;
}

h3 {
  margin-top: 1rem;
  font-weight: 500;
  color: #b3e5ff;
}

button {
  padding: 0.75rem 1.2rem;
  background-color: #00d2ff;
  color: #000;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: 1rem;
}

button:hover, button:focus {
  background-color: #00a2cc;
  outline: 2px solid #00d2ff;
}

/* Floating Labels */
.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-group input {
  width: 100%;
  padding: 1.2rem 1rem 0.6rem;
  font-size: 1rem;
  background: #fff;
  color: #000;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.form-group input:focus {
  border-color: #00d2ff;
  outline: none;
}

.form-group label {
  position: absolute;
  top: 0.9rem;
  left: 1rem;
  color: #888;
  font-size: 1rem;
  transition: all 0.2s ease;
  pointer-events: none;
  background: white;
  padding: 0 4px;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown):valid + label,
.form-group input:not(:focus):not(:placeholder-shown) + label {
  top: -0.6rem;
  left: 0.8rem;
  font-size: 0.8rem;
  color: #00a2cc;
}

.error-msg {
  color: #ff6b6b;
  font-weight: 500;
}

.success-msg {
  color: #4caf50;
  font-weight: 500;
}

.hidden {
  display: none !important;
}

#refLink {
  background-color: #333;
  padding: 0.5rem;
  border-radius: 5px;
  word-break: break-word;
}

#notAllowed {
  background: #ffc107;
  color: #000;
  padding: 1rem;
  margin-top: 1rem;
  border-radius: 6px;
}

.drop-zone {
  margin-top: 1rem;
  border: 2px dashed #ccc;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  color: #ccc;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.drop-zone.dragover {
  background-color: #1c3b4a;
  border-color: #00d2ff;
  color: #fff;
}

.drop-zone-label {
  display: block;
  margin-bottom: 0.5rem;
  color: #00d2ff;
  font-weight: 600;
  cursor: pointer;
}

.drop-zone img {
  max-width: 120px;
  max-height: 120px;
  margin-top: 1rem;
  border-radius: 50%;
  border: 2px solid #00d2ff;
  background: #fff;
}

@media (max-width: 600px) {
  .container {
    margin: 1rem;
    padding: 1.5rem;
  }
  .nav-title {
    font-size: 1.2rem;
  }
  .nav-links button {
    font-size: 0.9rem;
    padding: 0.4rem 0.7rem;
  }
}

.faq-item button {
  width: 100%;
  text-align: left;
  background: #1e2a38;
  color: #fff;
  padding: 1rem;
  border: none;
  border-radius: 5px;
  margin-top: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
}

.faq-item button:hover, .faq-item button:focus {
  background: #00d2ff;
  color: #000;
  outline: 2px solid #00a2cc;
}

.faq-answer {
  background: #32445a;
  padding: 1rem;
  border-radius: 5px;
  margin-bottom: 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1), padding 0.3s;
  padding: 0 1rem;
}

.faq-answer[aria-expanded="true"], .faq-answer:not(.hidden) {
  max-height: 200px;
  padding: 1rem;
}

.progress-bar-bg {
  background-color: #ccc;
  height: 14px;
  border-radius: 6px;
  margin: 0.5rem 0 1rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #00d2ff;
  width: 0%;
  transition: width 0.4s ease-in-out;
}

.badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.badge {
  background-color: #999;
  color: #fff;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.badge.achieved {
  background-color: #4caf50;
}

/* Accessibility: Focus for all interactive elements */
a, button, input, select, textarea {
  outline-color: #00d2ff;
  outline-width: 2px;
  outline-style: solid;
  outline-offset: 2px;
}

a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 2px solid #00d2ff;
}

/* Table styles for leaderboard */
#leaderboard table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
#leaderboard th, #leaderboard td {
  padding: 0.7rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #444;
}
#leaderboard th {
  background: #1e2a38;
  color: #00d2ff;
}
#leaderboard tr:nth-child(even) {
  background: rgba(0, 210, 255, 0.05);
}
#leaderboard tr:hover {
  background: #203a43;
}

/* Hero Section */
.hero {
  background: linear-gradient(120deg, #00d2ff 0%, #2c5364 100%);
  color: #fff;
  text-align: center;
  padding: 3rem 1rem 2rem 1rem;
  border-radius: 0 0 20px 20px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}
.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}
.cta-btn {
  background: #fff;
  color: var(--primary);
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 24px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  margin-top: 1rem;
  margin-bottom: 1rem;
  transition: background 0.2s, color 0.2s;
}
.cta-btn:hover, .cta-btn:focus {
  background: var(--accent);
  color: #fff;
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  min-width: 220px;
  max-width: 320px;
  background: #222;
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  font-size: 1rem;
  transition: opacity 0.3s, top 0.3s;
}
.toast.show {
  opacity: 1;
  pointer-events: auto;
  top: 2.5rem;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 10000;
  transition: background 0.2s, color 0.2s;
}
.theme-toggle:hover, .theme-toggle:focus {
  background: #00d2ff;
  color: #222;
}

/* Password Visibility Toggle */
.password-group {
  position: relative;
}
.toggle-password {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.3rem;
  z-index: 2;
}
.toggle-password:focus {
  outline: 2px solid #00d2ff;
}

/* Password Strength Meter */
.password-strength {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: #222;
  border-radius: 5px;
  padding: 0.3rem 0.7rem;
  display: inline-block;
}
.password-strength.weak {
  background: #ff6b6b;
  color: #fff;
}
.password-strength.medium {
  background: #ffc107;
  color: #222;
}
.password-strength.strong {
  background: #4caf50;
  color: #fff;
}

/* Dark/Light Mode */
body.light-mode {
  background: linear-gradient(to right, #f0f0f0, #e0e0e0);
  color: #222;
}
body.light-mode nav {
  background: #fff;
  color: #222;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
body.light-mode .container {
  background: rgba(0,0,0,0.03);
  color: #222;
}
body.light-mode .hero {
  background: linear-gradient(120deg, #fff 0%, #b3e5ff 100%);
  color: #222;
}
body.light-mode .theme-toggle {
  background: #fff;
  color: #00d2ff;
}
body.light-mode .toast {
  background: #fff;
  color: #222;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
body.light-mode .progress-bar-bg {
  background: #e0e0e0;
}
body.light-mode .progress-bar-fill {
  background: #00a2cc;
}
body.light-mode .faq-item button {
  background: #e0f7fa;
  color: #222;
}
body.light-mode .faq-answer {
  background: #b3e5ff;
  color: #222;
}
body.light-mode .badge {
  background: #bdbdbd;
  color: #222;
}
body.light-mode .badge.achieved {
  background: #388e3c;
  color: #fff;
}

.cta-btn, .theme-toggle, button {
  outline: none;
  transition: box-shadow 0.2s, background 0.2s, color 0.2s;
}
.cta-btn:focus, .theme-toggle:focus, button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--accent);
}

/* Ensure all buttons are visually distinct and accessible */
button, .cta-btn {
  cursor: pointer;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  padding: 0.7rem 1.5rem;
  background: var(--primary);
  color: #fff;
  margin: 0.2rem 0.3rem;
}
button:hover, .cta-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* --- Modal styles for account activation with Mpesa --- */
.modal {
  display: none;
  position: fixed;
  z-index: 10010;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(0,0,0,0.4);
  justify-content: center;
  align-items: center;
}
.modal .modal-content {
  background: #fff;
  color: #222;
  margin: auto;
  padding: 2rem 2.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  max-width: 350px;
  text-align: center;
  position: relative;
}
.modal .close-btn {
  position: absolute;
  right: 1.2rem;
  top: 1.2rem;
  color: #333;
  font-size: 1.5rem;
  cursor: pointer;
  font-weight: 600;
  background: none;
  border: none;
}
.modal .modal-content textarea {
  border-radius: 7px;
  border: 1px solid #bbb;
  padding: 0.7rem;
  font-size: 1rem;
  resize: vertical;
  margin-top: 0.5rem;
  background: #f8f8f8;
  color: #222;
  min-height: 80px;
  max-height: 200px;
  width: 100%;
  box-sizing: border-box;
}
.modal .modal-content textarea:focus {
  outline: 2px solid #00d2ff;
  border-color: #00d2ff;
  background: #fff;
}
#mpesaVerifyStatus {
  font-size: 1rem;
  text-align: left;
  min-height: 20px;
}
.modal .cta-btn {
  margin-top: 1.5rem;
}
.modal:not(.hidden) {
  display: flex;
}
/* Prevent scroll when modal is open */
body.modal-open {
  overflow: hidden;
}
/* Stylish look for the confirm payment (Verify Payment) button in activation modal */
#activationModal .cta-btn,
#verifyMpesaBtn {
  background: linear-gradient(90deg, #00d2ff 0%, #3a7bd5 100%);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 0.9rem 2.3rem;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 12px rgba(0,210,255,0.15);
  transition: 
    background 0.2s, 
    color 0.18s, 
    transform 0.08s, 
    box-shadow 0.18s;
  cursor: pointer;
  outline: none;
  display: inline-block;
}

#activationModal .cta-btn:hover,
#verifyMpesaBtn:hover,
#activationModal .cta-btn:focus,
#verifyMpesaBtn:focus {
  background: linear-gradient(90deg, #3a7bd5 0%, #00d2ff 100%);
  color: #fff;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 4px 22px rgba(0,210,255,0.28), 0 2px 8px rgba(58,123,213,0.10);
}

#activationModal .cta-btn:active,
#verifyMpesaBtn:active {
  background: linear-gradient(90deg, #00d2ff 0%, #3a7bd5 80%);
  transform: scale(0.98);
  box-shadow: 0 1.5px 6px rgba(0,210,255,0.12);
}
/* Wallet Styles */
#wallet .wallet-summary {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}
#wallet .wallet-summary > div {
  font-size: 1.2rem;
  background: #f8f9fa;
  padding: 0.8em 1.3em;
  border-radius: 18px;
  border: 1px solid #eee;
  min-width: 170px;
}
#wallet .cta-btn {
  margin-left: auto;
  margin-right: 1rem;
}
.wallet-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
  background: #fff;
}
.wallet-table th, .wallet-table td {
  border: 1px solid #eee;
  padding: 0.6em 1em;
  text-align: left;
}
.wallet-table th {
  background: #f0f4fa;
}
.wallet-table tr:nth-child(even) {
  background: #f9f9f9;
}
.wallet-table .status-pending { color: #d18c00; }
.wallet-table .status-completed { color: #228b22; }
.wallet-table .status-rejected { color: #d11a1a; }

/* Withdrawal Modal Styles */
#withdrawalModal.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 5000; background: rgba(0,0,0,0.35);
}
#withdrawalModal .modal-content {
  background: #fff;
  padding: 2em 2.6em;
  border-radius: 18px;
  max-width: 360px;
  width: 100%;
  position: relative;
}
#closeWithdrawalModal {
  position: absolute;
  top: 0.6em; right: 1em;
  background: none; border: none;
  font-size: 2em;
  color: #888;
  cursor: pointer;
}
#withdrawalForm label {
  display: block;
  margin-bottom: 1em;
  font-size: 1em;
}
#withdrawalForm input, #withdrawalForm select {
  width: 100%;
  font-size: 1em;
  margin-top: 0.3em;
  padding: 0.5em;
  border-radius: 7px;
  border: 1px solid #ccc;
}
#withdrawalForm .cta-btn {
  width: 100%;
}
.site-logo {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 0 2px rgba(0, 255, 255, 0.5));
  transition: transform 0.3s ease-in-out;
}
.site-logo:hover {
  transform: scale(1.05);
}

.login-logo-container {
  text-align: center;
  margin-bottom: 1rem;
}

.dashboard-logo {
  position: absolute;
  top: 1rem;
  right: 1rem;
}
/* Logo base styling */
.site-logo {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 0 3px rgba(0, 255, 255, 0.5));
  animation: pulseGlow 3s ease-in-out infinite, rotateLogo 20s linear infinite;
  transition: transform 0.3s ease-in-out;
}

/* Pulse glow animation */
@keyframes pulseGlow {
  0%, 100% {
    filter: drop-shadow(0 0 3px rgba(0, 255, 255, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.9));
  }
}

/* Gentle rotation animation */
@keyframes rotateLogo {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Positioning in login page */
.login-logo-container {
  text-align: center;
  margin-bottom: 1rem;
}

/* Positioning in dashboard */
.dashboard-logo {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}
/* Logo animation and style */
.site-logo {
  height: 40px;
  width: auto;
  animation: pulseTealGlow 3s ease-in-out infinite, rotateLogo 20s linear infinite;
  transition: transform 0.3s ease-in-out;
  filter: drop-shadow(0 0 5px rgba(0, 255, 170, 0.6));
}

/* Teal pulse glow effect */
@keyframes pulseTealGlow {
  0%, 100% {
    filter: drop-shadow(0 0 5px rgba(0, 255, 170, 0.6));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(0, 255, 170, 1));
  }
}

/* Smooth 360° rotation */
@keyframes rotateLogo {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Position in login screen */
.login-logo-container {
  text-align: center;
  margin-bottom: 1rem;
}

/* Dashboard logo placement */
.dashboard-logo {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}
.note-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}
