/* ===========================
   LinksTerra - Complete CSS
   =========================== */

/* --- CSS Variables --- */
:root {
  --primary: #00ff88;
  --primary-dark: #00cc6a;
  --bg-dark: #0a0a0a;
  --bg-card: rgba(15, 15, 15, 0.95);
  --border-glow: rgba(0, 255, 136, 0.3);
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --success: #2ecc71;
  --error: #e74c3c;
  --warning: #f39c12;
}

/* --- Reset & Base --- */
* { box-sizing: border-box; }

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* --- Custom Components --- */

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  text-decoration: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 255, 136, 0.3);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-danger {
  background: linear-gradient(135deg, var(--error), #c0392b);
  color: #fff;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  text-decoration: none;
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  text-decoration: none;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.875rem;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.3s ease;
  outline: none;
}
.input-field::placeholder { color: var(--text-secondary); }
.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.15);
}
select.input-field { appearance: auto; }
textarea.input-field { resize: vertical; min-height: 80px; font-family: inherit; }

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.stat-card h3 {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 4px 0;
}
.stat-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 3px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.step-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.step-btn:hover:not(:disabled) { transform: translateY(-2px); }
.step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.step-btn.completed {
  background: rgba(46, 204, 113, 0.2) !important;
  color: var(--success) !important;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.fade-in { animation: fadeIn 0.5s ease-in; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.2); }
  50% { box-shadow: 0 0 25px rgba(0, 255, 136, 0.4); }
}

/* --- Alert Boxes --- */
.alert-error {
  padding: 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 0.875rem;
}
.alert-success {
  padding: 12px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
  font-size: 0.875rem;
}

/* --- Navigation --- */
.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-user {
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.nav-user i { margin-right: 6px; }

.dashboard-main {
  max-width: 1152px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 16px;
}

/* --- Utility Classes (Tailwind equivalents) --- */

/* Display */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.inline-block { display: inline-block; }
.block { display: block; }
.grid { display: grid; }
.hidden { display: none; }

/* Flex */
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* Grid */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Gap */
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Spacing utilities */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* Padding */
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-12 { padding: 3rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pt-4 { padding-top: 1rem; }
.pb-4 { padding-bottom: 1rem; }

/* Margin */
.m-0 { margin: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-20 { margin-top: 5rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Width / Height */
.w-full { width: 100%; }
.w-7 { width: 1.75rem; }
.w-10 { width: 2.5rem; }
.h-7 { height: 1.75rem; }
.h-10 { height: 2.5rem; }
.min-w-0 { min-width: 0; }
.min-h-screen { min-height: 100vh; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-6xl { max-width: 72rem; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-disc { list-style-type: disc; }
.list-inside { list-style-position: inside; }

/* Colors */
.text-white { color: #fff; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-secondary); }
.text-light { color: #ccc; }
.text-red-400 { color: #f87171; }
.text-green-400 { color: #4ade80; }

/* Background */
.bg-primary-10 { background: rgba(0, 255, 136, 0.1); }
.bg-card-faint { background: rgba(255, 255, 255, 0.02); }
.bg-card-subtle { background: rgba(255, 255, 255, 0.05); }

/* Border */
.border { border: 1px solid rgba(255, 255, 255, 0.1); }
.border-b { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.border-t { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.border-subtle { border: 1px solid rgba(255, 255, 255, 0.05); }
.border-red { border-color: rgba(239, 68, 68, 0.3); }
.border-green { border-color: rgba(34, 197, 94, 0.3); }
.border-primary { border-color: rgba(0, 255, 136, 0.3); }

/* Border radius */
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Transition */
.transition { transition: all 0.3s ease; }
.transition-all { transition: all 0.3s ease; }

/* Accent */
.accent-primary { accent-color: var(--primary); }

/* Badge styles */
.badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-block;
}
.badge-active { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.badge-inactive { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Confirm box */
.confirm-box {
  padding: 1rem;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Step number circle */
.step-number {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.step-number-active {
  background: rgba(0, 255, 136, 0.1);
  color: var(--primary);
  border: 1px solid rgba(0, 255, 136, 0.3);
}
.step-number-completed {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.step-number-locked {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Color picker button */
.color-btn {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.color-btn.active {
  border-color: #fff;
  transform: scale(1.15);
}

/* Hover utilities */
.hover-primary:hover { color: var(--primary); }
.hover-underline:hover { text-decoration: underline; }

/* Loading spinner helper */
.spinner { animation: spin 1s linear infinite; }
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- Responsive --- */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:p-12 { padding: 3rem; }
}

/* --- Mobile Navigation --- */
@media (max-width: 768px) {
  .header-nav {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }
  .nav-actions {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
}
