/* Base styles shared across all pages */
:root {
  color-scheme: dark;
  --panel-radius: 12px;
  --accent-one: #38bdf8;
  --accent-two: #0284c7;
  --accent-three: #22c55e;
  --text: #f1f5f9;
  --subtle: #94a3b8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #020617;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.15), transparent 70%),
    radial-gradient(circle at 80% 80%, rgba(30, 41, 59, 0.3), transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-overflow-scrolling: touch;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('https://grainy-gradients.vercel.app/noise.svg');
  opacity: 0.25;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

/* Common animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Common panel styles */
.panel {
  border-radius: var(--panel-radius);
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 32px;
  /* backdrop-filter: blur(18px); REMOVED for scroll performance */
}

/* Common button styles */
.button,
.ghost-button {
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.button {
  background: linear-gradient(120deg, var(--accent-one), var(--accent-two));
  color: #05050a;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: var(--text);
}

.ghost-button--small {
  padding: 6px 14px;
  font-size: 0.9rem;
  border-radius: 10px;
}

.button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

/* Common form styles */
.form-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.form-control span {
  font-size: 0.85rem;
  color: var(--subtle);
}

input,
select,
textarea {
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-one);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* Loading spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--accent-one);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Status badges */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-chip--success {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-chip--warning {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-chip--info {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--subtle);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Logo */
.logo {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

/* Back link */
.back-link {
  color: var(--subtle);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.back-link:hover {
  color: var(--text);
}

/* Table styles */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
  font-weight: 600;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Admin chip */
.admin-chip {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--subtle);
}

/* Feedback messages */
.feedback {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.feedback--error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: block;
}

.feedback--success {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
  display: block;
}

/* Mobile responsiveness helpers */
@media (max-width: 640px) {
  .panel {
    padding: 20px;
    border-radius: 8px;
  }
  
  .button,
  .ghost-button {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}
