/* ============================================================
   CryptoFaucet Main Stylesheet
   ============================================================ */

:root {
  --primary: #f58f0b;
  --primary-dark: #d96a06;
  --bg: #080c14;
  --bg2: #0d1424;
  --bg3: #131d32;
  --border: #1a2744;
  --text: #e2e8f0;
  --text-muted: #64748b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.font-display {
  font-family: 'Syne', sans-serif;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg2);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Cards */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.card-sm {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #f58f0b, #d96a06);
  color: #000;
  font-weight: 600;
  border-radius: 10px;
  padding: .7rem 1.5rem;
  transition: all .2s;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(245, 143, 11, .4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
  border-radius: 10px;
  padding: .7rem 1.5rem;
  transition: all .2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: rgba(239, 68, 68, .15);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #f87171;
  font-weight: 500;
  border-radius: 10px;
  padding: .5rem 1rem;
  transition: all .2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, .3);
}

.btn-success {
  background: rgba(34, 197, 94, .15);
  border: 1px solid rgba(34, 197, 94, .3);
  color: #4ade80;
  font-weight: 500;
  border-radius: 10px;
  padding: .5rem 1rem;
  transition: all .2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.btn-success:hover {
  background: rgba(34, 197, 94, .3);
}

/* Inputs */
.input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: .75rem 1rem;
  width: 100%;
  transition: border-color .2s;
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 143, 11, .12);
}

.input::placeholder {
  color: var(--text-muted);
}

.label {
  font-size: .85rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: .4rem;
  display: block;
}

/* Badges */
.badge {
  padding: .2rem .6rem;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.badge-success {
  background: rgba(34, 197, 94, .15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, .2);
}

.badge-warning {
  background: rgba(245, 158, 11, .15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, .2);
}

.badge-danger {
  background: rgba(239, 68, 68, .15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, .2);
}

.badge-info {
  background: rgba(59, 130, 246, .15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, .2);
}

.badge-secondary {
  background: rgba(100, 116, 139, .15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, .2);
}

/* Table */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--bg3);
  padding: .85rem 1rem;
  text-align: left;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}

td {
  padding: .85rem 1rem;
  border-top: 1px solid var(--border);
  font-size: .9rem;
  vertical-align: middle;
}

tr:hover td {
  background: rgba(255, 255, 255, .015);
}

/* Flash messages */
.flash-success {
  background: rgba(34, 197, 94, .12);
  border: 1px solid rgba(34, 197, 94, .25);
  color: #4ade80;
  padding: 1rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.flash-error {
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(239, 68, 68, .25);
  color: #f87171;
  padding: 1rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.flash-warning {
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .25);
  color: #fbbf24;
  padding: 1rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: .75rem;
}

/* Gradient text */
.grad-text {
  background: linear-gradient(135deg, #f58f0b, #fdd98a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glow divider */
.glow-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 143, 11, .5), transparent);
}

/* Navbar */
.nav-link {
  color: #94a3b8;
  transition: color .2s;
  font-size: .9rem;
  font-weight: 500;
  padding: .4rem .75rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: rgba(245, 143, 11, .08);
}

/* Stat card */
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: border-color .3s, transform .3s;
}

.stat-card:hover {
  border-color: rgba(245, 143, 11, .3);
  transform: translateY(-2px);
}

/* Coin icon */
.coin-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  font-family: 'Syne', sans-serif;
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(245, 143, 11, .2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Toggle */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1a2744;
  border-radius: 24px;
  transition: .3s;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #64748b;
  border-radius: 50%;
  transition: .3s;
}

.toggle input:checked + .toggle-slider {
  background: rgba(245, 143, 11, .25);
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background: var(--primary);
}

/* Progress bar */
.progress-bar {
  background: var(--border);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #f58f0b, #fdd98a);
  transition: width .6s ease;
}

/* Sidebar */
.sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  width: 260px;
  flex-shrink: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: 10px;
  color: #94a3b8;
  font-size: .9rem;
  font-weight: 500;
  transition: all .2s;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-link:hover {
  background: rgba(245, 143, 11, .08);
  color: var(--primary);
}

.sidebar-link.active {
  background: rgba(245, 143, 11, .12);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}

.sidebar-section {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #475569;
  padding: .75rem 1rem .4rem;
  font-weight: 600;
}

/* Profile Dropdown */
.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + .5rem);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  z-index: 50;
  overflow: hidden;
}

/* User Layout Container */
.user-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}

.user-main {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

/* Balance Badge */
.balance-badge {
  background: #ffffff;
  border-radius: 12px;
  padding: .5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.balance-badge-label {
  font-size: .65rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .2rem;
  font-weight: 600;
}

.balance-badge-amount {
  font-size: .95rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  text-align: center;
}

.balance-badge-usd {
  font-size: .7rem;
  color: #64748b;
  margin-top: .15rem;
}

/* Animations */
[data-aos] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}

[data-aos].aos-animate {
  opacity: 1;
  transform: translateY(0);
}

/* Admin Layout Styles */
.admin-sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  width: 250px;
  min-height: 100vh;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem .9rem;
  border-radius: 8px;
  color: #94a3b8;
  font-size: .875rem;
  font-weight: 500;
  transition: all .2s;
  text-decoration: none;
  margin: .1rem 0;
}

.admin-sidebar-link:hover,
.admin-sidebar-link.active {
  background: rgba(245, 143, 11, .1);
  color: var(--primary);
}

.admin-sidebar-link.active {
  border-left: 3px solid var(--primary);
  padding-left: calc(.9rem - 3px);
}

.admin-sidebar-section {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #334155;
  padding: .6rem .9rem .2rem;
  font-weight: 700;
}

.admin-main-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.admin-page-header {
  margin-bottom: 2rem;
}

.admin-page-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f58f0b, #fdd98a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive */
@media (max-width: 768px) {
  .balance-badge {
    min-width: 100px;
    padding: .4rem .75rem;
  }
  
  .balance-badge-amount {
    font-size: .85rem;
  }
  
  .balance-badge-usd {
    font-size: .65rem;
  }
}
