/* ============================================================
   DOVAPAY — Main Stylesheet
   Font: Inter | Primary: #0A0E27 | Accent: #6366f1
   ============================================================ */

/* 1. CSS Variables — Full Design Token System */
:root {
  /* Brand Colors */
  --color-primary:       #0A0E27;
  --color-accent:        #6366f1;
  --color-accent-hover:  #4f46e5;
  --color-success:       #10b981;
  --color-warning:       #f59e0b;
  --color-danger:        #ef4444;
  --color-surface:       #f8fafc;
  --color-card:          #ffffff;
  --color-border:        #e2e8f0;
  --color-text-main:     #111827;
  --color-text-muted:    #6b7280;
  --color-text-light:    #9ca3af;

  /* Legacy aliases */
  --primary:             var(--color-accent);
  --primary-hover:       var(--color-accent-hover);
  --secondary:           var(--color-success);
  --bg:                  var(--color-surface);
  --card-bg:             var(--color-card);
  --text-dark:           var(--color-text-main);
  --text-muted:          var(--color-text-muted);
  --success:             var(--color-success);
  --warning:             var(--color-warning);
  --danger:              var(--color-danger);
  --border:              var(--color-border);
  --glass-bg:            rgba(255, 255, 255, 0.7);
  --glass-border:        rgba(255, 255, 255, 0.3);
}

/* 2. Base Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--color-surface);
  color: var(--color-text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 3. App Container */
.app-container {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--color-surface);
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
  overflow-x: hidden;
  padding-bottom: 80px;
}

/* 4. Splash Screen */
#splash-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: linear-gradient(160deg, #0A0E27 0%, #111827 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}
#splash-screen.hide { opacity: 0; visibility: hidden; }
.splash-logo { animation: pulse 2.5s infinite ease-in-out; }
@keyframes pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* 5. Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 64px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid var(--color-border);
  z-index: 1000;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  flex: 1;
}
.nav-item i { font-size: 24px; margin-bottom: 2px; transition: transform 0.2s ease; }
.nav-item.active { color: var(--color-accent); }
.nav-item.active i { transform: translateY(-2px); }

/* 6. Card Styles */
.card {
  background-color: var(--color-card);
  border: 1.5px solid var(--color-border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(10, 14, 39, 0.07);
  padding: 16px;
}

/* 7. Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-decoration: none;
}
.btn-primary {
  background-color: #0A0E27;
  color: white;
  box-shadow: 0 4px 12px rgba(10, 14, 39, 0.2);
}
.btn-primary:hover, .btn-primary:active {
  background-color: #161c3d;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(10, 14, 39, 0.28);
}
.btn-accent {
  background-color: var(--color-accent);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-accent:hover, .btn-accent:active {
  background-color: var(--color-accent-hover);
  transform: translateY(-1px);
}
.btn-secondary { background-color: #EEF2FF; color: var(--color-accent); }
.btn-secondary:hover { background-color: #E0E7FF; }
.btn-success { background-color: var(--color-success); color: white; }
.btn-danger  { background-color: var(--color-danger); color: white; }
.btn-outline { background-color: transparent; border: 1.5px solid var(--color-border); color: var(--color-text-main); }
.btn-outline:hover { background-color: var(--color-surface); }

/* 8. Toast */
.toast-container {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 9999; width: 90%; max-width: 400px;
}
.toast {
  display: flex; align-items: center; padding: 16px;
  border-radius: 12px; margin-bottom: 10px; color: white;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  animation: slideDown 0.3s ease-out forwards;
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.toast-hide { animation: fadeOut 0.3s ease-in forwards; }
@keyframes fadeOut {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(-10px); opacity: 0; }
}
.toast-success { background-color: var(--color-success); }
.toast-error   { background-color: var(--color-danger); }
.toast-info    { background-color: var(--color-accent); }
.toast-warning { background-color: var(--color-warning); }

/* 9. Skeleton */
.skeleton {
  background: linear-gradient(90deg, #E5E7EB 25%, #F3F4F6 50%, #E5E7EB 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text   { height: 16px; width: 100%; margin-bottom: 8px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-card   { height: 120px; width: 100%; border-radius: 16px; }

/* 10. Page Transition */
.page-enter { animation: slideInRight 0.3s forwards; }
.page-exit  { animation: slideOutLeft 0.3s forwards; }
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(-100%); opacity: 0; }
}

/* 11. Forms */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  font-family: 'Inter', sans-serif;
  color: var(--color-text-main); margin-bottom: 6px;
}
.form-input {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  border: 1.5px solid var(--color-border);
  background-color: var(--color-surface);
  font-family: 'Inter', sans-serif; font-size: 14px; transition: all 0.2s;
}
.form-input:focus {
  outline: none; border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background-color: var(--color-card);
}

/* 12. Badges */
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; font-family: 'Inter', sans-serif;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-pending                    { background-color: #FEF3C7; color: #D97706; }
.badge-approved, .badge-active    { background-color: #D1FAE5; color: #059669; }
.badge-rejected, .badge-inactive  { background-color: #FEE2E2; color: #DC2626; }

/* 13. Banner Slider */
.banner-slider { position: relative; overflow: hidden; border-radius: 16px; margin-bottom: 24px; }
.banner-slide { display: none; width: 100%; transition: transform 0.5s ease; }
.banner-slide.active { display: block; }
.banner-slide img { width: 100%; height: auto; display: block; border-radius: 16px; }
.banner-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background-color: rgba(255,255,255,0.5); transition: all 0.2s; }
.dot.active { background-color: white; width: 12px; border-radius: 4px; }

/* 14. Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }

/* 15. Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(2px);
  z-index: 10000; display: flex; align-items: flex-end;
  opacity: 0; visibility: hidden; transition: all 0.3s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-content {
  background: white; width: 100%; max-width: 430px; margin: 0 auto;
  border-radius: 24px 24px 0 0; padding: 24px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
}
.modal-overlay.show .modal-content { transform: translateY(0); }

/* 16. Scrollbar */
::-webkit-scrollbar { width: 0px; background: transparent; }
.scrollable { overflow-y: scroll; -ms-overflow-style: none; scrollbar-width: none; }

/* 17. Pull-to-refresh */
.refresh-indicator {
  position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
  width: 32px; height: 32px; background: white; border-radius: 50%;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-accent); z-index: 900; transition: top 0.2s ease;
}
.refreshing { top: 20px; animation: spin 1s linear infinite; }

/* 18. Loader */
.loader-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255,255,255,0.8); backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: center;
  z-index: 10000; opacity: 0; visibility: hidden; transition: all 0.2s;
}
.loader-overlay.active { opacity: 1; visibility: visible; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--color-accent);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* 19. File upload */
.upload-preview {
  width: 100%; height: 140px; border: 2px dashed var(--color-border);
  border-radius: 12px; display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  color: var(--color-text-muted); background-color: var(--color-surface);
  cursor: pointer; overflow: hidden; position: relative; transition: background 0.2s;
}
.upload-preview:hover { background-color: #EEF2FF; border-color: var(--color-accent); }
.upload-preview img { width: 100%; height: 100%; object-fit: contain; position: absolute; top: 0; left: 0; }

/* 20. Page Hero / Header */
.page-hero, .hero-section {
  background: linear-gradient(160deg, #0A0E27 0%, #111827 100%);
  color: white;
  padding: 20px 18px 24px;
}

/* 21. Admin */
.admin-sidebar {
  width: 250px; height: 100vh; position: fixed; left: 0; top: 0;
  background-color: white; border-right: 1px solid var(--color-border);
  padding: 20px; overflow-y: auto; font-family: 'Inter', sans-serif;
}
.admin-main {
  margin-left: 250px; padding: 24px; background-color: var(--color-surface);
  min-height: 100vh; width: calc(100% - 250px); font-family: 'Inter', sans-serif;
}
.admin-card {
  background: white; border-radius: 12px; padding: 24px;
  border: 1.5px solid var(--color-border); margin-bottom: 24px;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 16px 12px; text-align: left;
  border-bottom: 1px solid var(--color-border); font-family: 'Inter', sans-serif;
}
.admin-table th { font-weight: 600; color: var(--color-text-main); background: #F9FAFB; }

/* 22. Copyright Footer */
.app-footer {
  text-align: center; padding: 16px; font-size: 12px;
  color: var(--color-text-light); font-family: 'Inter', sans-serif;
  border-top: 1px solid var(--color-border);
}
