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

/* Color & Theme Variables (Stripe / Vercel Aesthetic) */
:root {
  /* Common Token Colors */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --primary: #4f46e5;       /* Indigo */
  --primary-hover: #4338ca;
  --success: #10b981;       /* Emerald */
  --success-bg: rgba(16, 185, 129, 0.1);
  --danger: #ef4444;        /* Rose */
  --danger-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;       /* Amber */
  --warning-bg: rgba(245, 158, 11, 0.1);
  --info: #0ea5e9;          /* Sky */
  --info-bg: rgba(14, 165, 233, 0.1);

  /* Light Theme Variables */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #cbd5e1;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
}

/* Dark Mode (Night Mode) Colors */
body.dark-mode {
  --bg: #090d16;
  --surface: #111827;
  --surface-hover: #1f2937;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #1f2937;
  --border-focus: #374151;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
}

/* Reset and General Settings */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Core Layouts */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
  background-color: var(--surface-hover);
}

.nav-link.active {
  color: var(--primary);
  background-color: var(--success-bg);
}

/* Main Layout Grid */
main {
  flex-grow: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Dashboard Announcement Banner (Bubble Notification) */
.announcement-banner {
  background-color: var(--info-bg);
  border: 1px solid var(--info);
  color: var(--text);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideDown 0.3s ease-out;
}

.announcement-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.announcement-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.announcement-close:hover {
  color: var(--text);
  background-color: rgba(0, 0, 0, 0.05);
}

/* Typography & Headers */
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* Cards System */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.stat-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.stat-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  gap: 0.5rem;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background-color: var(--surface-hover);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
}

.btn-lg {
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  color: var(--text);
}

.form-control {
  width: 100%;
  font-family: var(--font-family);
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
  background-color: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease;
}

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

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Auth Screens Layout */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background-color: var(--bg);
}

.auth-card {
  max-width: 420px;
  width: 100%;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* Tables Styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--surface);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

th {
  background-color: var(--surface-hover);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: var(--surface-hover);
}

/* Badges Status styling */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  text-transform: capitalize;
}

.badge-pending {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-processing {
  background-color: rgba(14, 165, 233, 0.1);
  color: var(--info);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-failed {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-verification {
  background-color: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

/* Alerts System */
.alert {
  padding: 0.85rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.alert-success {
  background-color: var(--success-bg);
  border-color: var(--success);
  color: var(--text);
}

.alert-danger {
  background-color: var(--danger-bg);
  border-color: var(--danger);
  color: var(--text);
}

/* Dropdowns & Utilities */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.text-right {
  text-align: right;
}

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mr-2 { margin-right: 0.5rem; }

/* Custom Bulk Validation Styles */
.bulk-line-error {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444;
}

.validation-box {
  border-radius: 6px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  display: none;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-width: 500px;
  width: 90%;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transform: translateY(-20px);
  transition: transform 0.2s ease;
}

.modal-backdrop.show .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* Night Mode Switcher Styling */
.theme-switch-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-switch-btn:hover {
  background-color: var(--surface-hover);
}

.theme-switch-btn svg {
  width: 18px;
  height: 18px;
}

/* Night Mode specific overrides */
body.dark-mode .sun-icon {
  display: block;
}
body.dark-mode .moon-icon {
  display: none;
}
body:not(.dark-mode) .sun-icon {
  display: none;
}
body:not(.dark-mode) .moon-icon {
  display: block;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  main {
    padding: 1.5rem 1rem;
  }
}
