@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #0f0f0f;
  --card-bg: #1a1a1a;
  --text: #f0f0f0;
  --text-secondary: #a0a0a0;
  --primary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border: #2d2d2d;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  --bg: #ffffff;
  --card-bg: #ffffff;
  --text: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  transition: background 0.3s, color 0.3s;
  padding: 20px;
  min-height: 100vh;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

.card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  border: 1px solid var(--border);
  transition: transform 0.3s;
}
.card:hover {
  transform: translateY(-4px);
}

h1, h2, h3 {
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

/* Form & Input */
.form-group {
  margin-bottom: 20px;
}
label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}
input, select {
  width: 100%;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: #7c3aed;
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: rgba(139, 92, 246, 0.1);
}

/* Alerts */
.alert {
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}
.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
}
.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* Progress Bar */
.progress-container {
  height: 12px;
  background: #2d2d2d;
  border-radius: 6px;
  overflow: hidden;
  margin: 24px 0;
}
#progressBar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #ec4899);
  width: 0%;
  transition: width 0.5s ease;
}

/* Status Grid */
.status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 20px;
}
.status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}
.status-item span:first-child {
  font-size: 18px;
  width: 24px;
  text-align: center;
}
.account-id {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 12px 0;
  z-index: 100;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  transition: color 0.2s;
}
.bottom-nav a.active, .bottom-nav a:hover {
  color: var(--primary);
}
.bottom-nav i {
  font-size: 20px;
  margin-bottom: 4px;
}

/* Footer */
.footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Responsive */
@media (min-width: 769px) {
  .bottom-nav {
    display: none;
  }
  .card {
    margin-bottom: 24px;
  }
}
@media (max-width: 768px) {
  .card {
    padding: 24px;
    margin-bottom: 80px;
  }
  h2 {
    font-size: 1.8rem;
  }
}
/* Traffic Stats */
.stats {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.stat-card {
  background: rgba(139, 92, 246, 0.1);
  padding: 20px;
  border-radius: 16px;
  text-align: center;
  flex: 1;
  min-width: 120px;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Responsive Stats */
@media (max-width: 768px) {
  .stats {
    flex-direction: column;
    gap: 12px;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-value {
    font-size: 1.8rem;
  }
}
/* Leaderboard Styling */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  background-color: #333; /* Darker background for items */
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease-in-out;
}

.leaderboard-item:hover {
  transform: translateY(-2px);
}

.leaderboard-item .rank-number {
  font-size: 1.2em;
  font-weight: bold;
  width: 30px; /* Lebar tetap untuk nomor peringkat */
  text-align: center;
  margin-right: 15px;
  color: #a0aec0; /* Abu-abu untuk peringkat standar */
}

.leaderboard-item.rank-1 .rank-number {
  color: gold;
  font-size: 1.4em;
  text-shadow: 0 0 8px rgba(255,215,0,0.8);
}

.leaderboard-item.rank-2 .rank-number {
  color: silver;
  font-size: 1.3em;
}

.leaderboard-item.rank-3 .rank-number {
  color: #cd7f32; /* Bronze */
  font-size: 1.25em;
}


.leaderboard-item .profile-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 15px;
  border: 2px solid #555; /* Border untuk foto profil */
}

.leaderboard-item.rank-1 .profile-pic {
    border-color: gold;
}
.leaderboard-item.rank-2 .profile-pic {
    border-color: silver;
}
.leaderboard-item.rank-3 .profile-pic {
    border-color: #cd7f32;
}


.leaderboard-item .username {
  flex-grow: 1; /* Ambil sisa ruang */
  font-weight: 600;
  color: #e2e8f0; /* Warna teks username standar */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-item .donation-amount {
  font-weight: bold;
  color: #48bb78; /* Hijau untuk jumlah donasi */
  margin-left: 15px;
  white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .leaderboard-item {
    padding: 8px 10px;
  }
  .leaderboard-item .profile-pic {
    width: 35px;
    height: 35px;
    margin-right: 10px;
  }
  .leaderboard-item .rank-number {
    font-size: 1.1em;
    width: 25px;
    margin-right: 10px;
  }
  .leaderboard-item.rank-1 .rank-number {
    font-size: 1.3em;
  }
}
/* Notifikasi Toast */
.toast-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--primary-light); /* Warna sesuai tema Anda */
  color: var(--white);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  font-size: 0.95em;
  opacity: 0;
  animation: fadeinout 5s forwards;
}

.toast-notification.success-toast {
  background-color: #4CAF50; /* Green for success */
}
.toast-notification.error-toast {
  background-color: #f44336; /* Red for error */
}

.toast-notification i {
  font-size: 1.2em;
}

@keyframes fadeinout {
  0% { opacity: 0; top: 0px; }
  10% { opacity: 1; top: 20px; }
  90% { opacity: 1; top: 20px; }
  100% { opacity: 0; top: 0px; }
}


/* Styling untuk Profil */
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.profile-picture-container {
  text-align: center;
}

.profile-picture-large {
  width: 150px; /* Ukuran tetap untuk foto profil */
  height: 150px;
  border-radius: 50%;
  object-fit: cover; /* Penting agar gambar tidak terdistorsi dan tidak melewati batas */
  border: 4px solid var(--primary); /* Contoh border */
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* Memastikan input file tidak terlalu besar */
.form-control-file {
    width: 100%; /* Memastikan input file mengikuti lebar container */
    padding: 8px;
    border: 1px solid #555;
    border-radius: 5px;
    background-color: #2e2e2e;
    color: #e2e8f0;
}

/* Memastikan gambar preview juga tidak melewati batas */
#imagePreview img {
    max-width: 100%;
    height: auto;
    display: block; /* Menghilangkan spasi ekstra di bawah gambar */
}

/* Perbaikan pada bottom-nav untuk tombol profil */
.bottom-nav a i {
  display: block;
  margin-bottom: 4px;
  font-size: 1.2em;
}
.bottom-nav a span {
  font-size: 0.75em;
}
