/* public/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inika:wght@400;700&family=Kode+Mono:wght@400..700&family=Oxanium:wght@300;400;500;600;700&display=swap');

:root {
  --background: #f5fcfc;
  --foreground: #021f22;
  --card: #ffffff;
  --card-foreground: #021f22;
  --popover: #ffffff;
  --popover-foreground: #021f22;
  --primary: #008da6;
  --primary-hover: #00778c;
  --primary-foreground: #ffffff;
  --secondary: #cef3f8;
  --secondary-foreground: #021f22;
  --muted: #e3f6f9;
  --muted-foreground: #4f696c;
  --accent: #b3e8ee;
  --accent-foreground: #03272a;
  --destructive: #d40924;
  --destructive-foreground: #ffffff;
  --border: #c5e1e4;
  --input: #c5e1e4;
  --input-bg: #ffffff;
  --ring: #008da6;
  --chart-1: #008da6;
  --chart-2: #00babb;
  --chart-3: #7ee1d4;
  --chart-4: #00688c;
  --chart-5: #0091c7;
  --sidebar: #18393d;
  --sidebar-foreground: #f1fafb;
  --sidebar-primary: #009ea1;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #244a4e;
  --sidebar-accent-foreground: #f1fafb;
  --sidebar-border: #244a4e;
  --sidebar-ring: #009ea1;
  --font-sans: 'Oxanium', system-ui, -apple-system, sans-serif;
  --font-serif: 'Inika', serif;
  --font-mono: 'Kode Mono', monospace;
  --radius: 0.225rem;
  --radius-sm: 0.175rem;
  --radius-pill: 9999px;
  
  --shadow-2xs: 0px 2px 20px -3.5px hsl(202.2581 60.7843% 20% / 0.28);
  --shadow-xs: 0px 2px 20px -3.5px hsl(202.2581 60.7843% 20% / 0.28);
  --shadow-sm: 0px 2px 20px -3.5px hsl(202.2581 60.7843% 20% / 0.57), 0px 1px 2px -4.5px hsl(202.2581 60.7843% 20% / 0.57);
  --shadow: 0px 2px 20px -3.5px hsl(202.2581 60.7843% 20% / 0.57), 0px 1px 2px -4.5px hsl(202.2581 60.7843% 20% / 0.57);
  --shadow-md: 0px 2px 20px -3.5px hsl(202.2581 60.7843% 20% / 0.57), 0px 2px 4px -4.5px hsl(202.2581 60.7843% 20% / 0.57);
  --shadow-lg: 0px 2px 20px -3.5px hsl(202.2581 60.7843% 20% / 0.57), 0px 4px 6px -4.5px hsl(202.2581 60.7843% 20% / 0.57);
  --shadow-xl: 0px 2px 20px -3.5px hsl(202.2581 60.7843% 20% / 0.57), 0px 8px 10px -4.5px hsl(202.2581 60.7843% 20% / 0.57);
  --shadow-2xl: 0px 2px 20px -3.5px hsl(202.2581 60.7843% 20% / 1.42);
}

.dark,
[data-theme="dark"] {
  --background: #010708;
  --foreground: #e8f1f1;
  --card: #031012;
  --card-foreground: #e8f1f1;
  --popover: #020b0c;
  --popover-foreground: #e8f1f1;
  --primary: #00cacc;
  --primary-hover: #00e0e3;
  --primary-foreground: #020d0f;
  --secondary: #0c1e20;
  --secondary-foreground: #e8f1f1;
  --muted: #0a191a;
  --muted-foreground: #7e9496;
  --accent: #033030;
  --accent-foreground: #e8f1f1;
  --destructive: #e62b34;
  --destructive-foreground: #ffffff;
  --border: #152729;
  --input: #152729;
  --input-bg: #031012;
  --ring: #00cacc;
  --chart-1: #00cacc;
  --chart-2: #00a7ba;
  --chart-3: #00877b;
  --chart-4: #32cfee;
  --chart-5: #00b0e8;
  --sidebar: #010405;
  --sidebar-foreground: #f3fafa;
  --sidebar-primary: #00cacc;
  --sidebar-primary-foreground: #020d0f;
  --sidebar-accent: #031517;
  --sidebar-accent-foreground: #f3fafa;
  --sidebar-border: #071416;
  --sidebar-ring: #00cacc;
  --font-sans: 'Oxanium', system-ui, -apple-system, sans-serif;
  --font-serif: 'Inika', serif;
  --font-mono: 'Kode Mono', monospace;
  --radius: 0.225rem;
  --radius-sm: 0.175rem;
  --radius-pill: 9999px;
  
  --shadow-2xs: 0px 2px 30px -3.5px hsl(181 93.7500% 25.0980% / 0.28);
  --shadow-xs: 0px 2px 30px -3.5px hsl(181 93.7500% 25.0980% / 0.28);
  --shadow-sm: 0px 2px 30px -3.5px hsl(181 93.7500% 25.0980% / 0.57), 0px 1px 2px -4.5px hsl(181 93.7500% 25.0980% / 0.57);
  --shadow: 0px 2px 30px -3.5px hsl(181 93.7500% 25.0980% / 0.57), 0px 1px 2px -4.5px hsl(181 93.7500% 25.0980% / 0.57);
  --shadow-md: 0px 2px 30px -3.5px hsl(181 93.7500% 25.0980% / 0.57), 0px 2px 4px -4.5px hsl(181 93.7500% 25.0980% / 0.57);
  --shadow-lg: 0px 2px 30px -3.5px hsl(181 93.7500% 25.0980% / 0.57), 0px 4px 6px -4.5px hsl(181 93.7500% 25.0980% / 0.57);
  --shadow-xl: 0px 2px 30px -3.5px hsl(181 93.7500% 25.0980% / 0.57), 0px 8px 10px -4.5px hsl(181 93.7500% 25.0980% / 0.57);
  --shadow-2xl: 0px 2px 30px -3.5px hsl(181 93.7500% 25.0980% / 1.42);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-color: var(--border);
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--background);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted-foreground);
}

/* Layout Utilities */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

/* Modern Airy Card */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* Headings */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

h1 {
  font-size: 2.25rem;
  color: var(--foreground);
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.15rem;
}

h4 {
  font-size: 0.95rem;
}

/* Form inputs */
input[type="text"],
input[type="url"],
input[type="password"],
input[type="email"],
input[type="datetime-local"] {
  width: 100%;
  padding: 11px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input);
  border-radius: var(--radius-sm);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.925rem;
  transition: all 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 141, 166, 0.2);
}

.dark input:focus {
  box-shadow: 0 0 0 3px rgba(0, 202, 204, 0.25);
}

input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.8;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.925rem;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.25;
}

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

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-secondary:hover {
  background: var(--muted);
  border-color: var(--input);
}

.btn-danger {
  background: var(--destructive);
  color: var(--destructive-foreground);
  border: 1px solid transparent;
}

.btn-danger:hover {
  opacity: 0.9;
}

.dark .btn-danger:hover {
  opacity: 0.9;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--muted);
}

/* Badges & Status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.725rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-active {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.dark .badge-active {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
}

.badge-inactive {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.dark .badge-inactive {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.badge-expired {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.dark .badge-expired {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

/* Collapsible Accordions & Panels */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  overflow: hidden;
  margin-top: 4px;
}

.accordion-header {
  padding: 10px 14px;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--foreground);
  transition: background 0.15s ease;
}

.accordion-header:hover {
  background: var(--accent);
}

.accordion-content {
  padding: 14px;
  display: none;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.accordion.open .accordion-content {
  display: block;
}

.accordion-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 0.8rem;
}

.accordion.open .accordion-icon {
  transform: rotate(180deg);
}

.preset-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.775rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--foreground);
}

.preset-pill:hover,
.preset-pill.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.utm-preview-box {
  background: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.775rem;
  word-break: break-all;
  color: var(--foreground);
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}



/* Search input */
.search-input {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--foreground);
  font-size: 0.9rem;
  width: 280px;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  outline: none;
}

/* Table Styling */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--muted);
  color: var(--muted-foreground);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

.dark tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--card);
  color: var(--card-foreground);
  width: 100%;
  max-width: 580px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
  margin: auto;
  max-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

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

.modal-header {
  padding: 1.15rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
}

.modal-close {
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-size: 1.15rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  line-height: 1;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--destructive);
  color: var(--destructive-foreground);
  border-color: var(--destructive);
}


/* Geolocation cards */
.geo-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.geo-card {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.alert-error {
  background: var(--destructive);
  color: var(--destructive-foreground);
  border: 1px solid rgba(235, 0, 31, 0.2);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.35s ease-out forwards;
}