/* Premium Design System for 70thd.uk */

:root {
  /* Color Palette */
  --bg-primary: hsl(224, 71%, 4%);
  --bg-card: rgba(17, 24, 39, 0.55);
  --bg-card-hover: rgba(31, 41, 55, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.18);
  
  --text-primary: hsl(0, 0%, 96%);
  --text-secondary: hsl(215, 20%, 65%);
  --text-muted: hsl(215, 12%, 46%);
  
  --accent-primary: hsl(263, 90%, 52%);
  --accent-secondary: hsl(280, 85%, 60%);
  --accent-cyan: hsl(186, 100%, 42%);
  
  --color-success: hsl(142, 69%, 45%);
  --color-error: hsl(350, 89%, 60%);
  --color-warning: hsl(38, 92%, 50%);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  --gradient-glow: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
  
  /* Layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Background Glow Decorations */
.bg-glow {
  position: fixed;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: screen;
}

.bg-glow-1 {
  top: -10%;
  left: -10%;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
}

.bg-glow-2 {
  bottom: -10%;
  right: -10%;
  background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
}

/* Glassmorphism base helper */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

@keyframes slideUp {
  from { opacity: 0; transform: scale(0.95) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-fade-in {
  animation: fadeIn var(--transition-normal) forwards;
}

.animate-slide-up {
  animation: slideUp var(--transition-normal) cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.hidden {
  display: none !important;
}

/* Global Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-primary);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
  opacity: 0.95;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-color-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--color-error);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

.btn-icon-only {
  padding: 10px;
  border-radius: var(--radius-sm);
}

.btn-full {
  width: 100%;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
  width: 100%;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-wrapper, .password-wrapper {
  position: relative;
  width: 100%;
}

.input-wrapper input, .password-wrapper input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px 12px 42px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.input-wrapper input:focus, .password-wrapper input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
  background: rgba(0, 0, 0, 0.4);
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.input-wrapper input:focus + .input-icon,
.password-wrapper input:focus + .input-icon {
  color: var(--accent-primary);
}

.form-help {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.error-msg {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--color-error);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* LOGIN VIEW */
.container-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  border-radius: var(--radius-md);
  text-align: center;
}

.brand {
  margin-bottom: 32px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.brand-logo i {
  width: 32px;
  height: 32px;
  color: white;
}

.brand h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* DASHBOARD NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  height: 70px;
  border-width: 0 0 1px 0;
  border-radius: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--accent-primary);
}

.nav-brand h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

.nav-brand h2 span {
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-badge i {
  width: 14px;
  height: 14px;
  color: var(--accent-primary);
}

/* DASHBOARD BODY CONTAINER */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* Stats Summary Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-hover);
}

.stat-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrapper.blue {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-cyan);
}

.stat-icon-wrapper.purple {
  background: rgba(139, 92, 246, 0.15);
  color: hsl(263, 90%, 65%);
}

.stat-icon-wrapper.green {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

.stat-icon-wrapper i {
  width: 24px;
  height: 24px;
}

.stat-content h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
}

/* Controls Panel */
.controls-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .controls-panel {
    flex-direction: column;
    align-items: stretch;
  }
}

.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 500px;
}

.search-wrapper input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px 12px 42px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.search-wrapper input:focus {
  outline: none;
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
}

.search-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Links Table */
.table-container {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-wrapper {
  overflow-x: auto;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background: rgba(0, 0, 0, 0.2);
  padding: 16px 24px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  letter-spacing: 0.05em;
}

td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  vertical-align: middle;
}

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

tr {
  transition: background-color var(--transition-fast);
}

tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Link Title Cell */
.link-details-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 250px;
}

.link-title {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Destination Cell */
.dest-url-cell {
  max-width: 250px;
}

.dest-url-cell a {
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: color var(--transition-fast);
}

.dest-url-cell a:hover {
  color: var(--accent-cyan);
}

/* Short Link Cell */
.short-url-cell {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
}

.short-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.short-link-badge:hover {
  border-color: var(--border-color-hover);
  background: rgba(255, 255, 255, 0.07);
}

.short-link-badge span {
  color: var(--accent-cyan);
}

.btn-copy-small {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.btn-copy-small:hover {
  color: var(--text-primary);
}

.btn-copy-small i {
  width: 14px;
  height: 14px;
}

/* Clicks Count Badge */
.clicks-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: hsl(263, 90%, 75%);
  padding: 4px 10px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.8rem;
}

.clicks-badge.zero {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* Created Date Cell */
.date-cell {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Actions Cell */
.actions-cell {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

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

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state i {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 320px;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.25rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-close-btn i {
  width: 20px;
  height: 20px;
}

.modal-body {
  padding: 24px;
}

#create-link-form {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

.justify-center {
  justify-content: center;
}

/* QR Code Modal Customizations */
.qr-modal-card {
  max-width: 400px;
}

.qr-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.qr-link-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--text-primary);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-container-glowing {
  background: white;
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qr-canvas {
  width: 200px !important;
  height: 200px !important;
  display: block;
}

.qr-link-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  width: 100%;
}

.qr-link-display span {
  flex: 1;
  font-weight: 600;
  color: var(--accent-cyan);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* Analytics Modal Customizations */
.stats-modal-card {
  max-width: 640px;
}

.stats-modal-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-sm);
}

.stats-modal-summary div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-modal-summary .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.stats-modal-summary strong {
  font-size: 1.1rem;
}

.stats-modal-summary strong.badge {
  color: var(--accent-cyan);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  margin-top: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.section-title i {
  width: 16px;
  height: 16px;
  color: var(--accent-primary);
}

.section-title h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.referrers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.referrer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
}

.referrer-name {
  color: var(--text-primary);
  font-weight: 500;
}

.referrer-count {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.clicks-history-table {
  width: 100%;
  font-size: 0.8rem;
}

.clicks-history-table th {
  padding: 8px 12px;
}

.clicks-history-table td {
  padding: 10px 12px;
}

/* Toast Message */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  animation: slideUp var(--transition-fast) forwards;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
}

.toast i {
  width: 18px;
  height: 18px;
  color: var(--accent-cyan);
}
