/* =============================================
   Woo2Shopify — Custom Styles (on top of Tailwind CDN)
   Theme: Midnight Forge (slate-950 + cyan)
   Fonts: Syne (display) + Figtree (body)
   ============================================= */

:root {
  --font-display: 'Syne', sans-serif;
  --font-body: 'Figtree', sans-serif;
  --color-bg: #020617;       /* slate-950 */
  --color-surface: #0f172a;  /* slate-900 */
  --color-border: #1e293b;   /* slate-800 */
  --color-accent: #22d3ee;   /* cyan-400 */
  --color-text: #e2e8f0;     /* slate-200 */
  --color-muted: #64748b;    /* slate-500 */
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Selection */
::selection { background: rgba(34, 211, 238, 0.2); color: #e2e8f0; }

/* Focus ring */
:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.5);
  outline-offset: 2px;
  border-radius: 8px;
}

/* =============================================
   Layout
   ============================================= */

.sidebar {
  width: 240px;
  min-width: 240px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  flex: 1;
}

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--color-border);
}

.main-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  height: 100vh;
}

/* Nav links */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.6rem 0.875rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  transition: all 0.15s ease;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 2px;
}

.nav-link:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,0.04);
}

.nav-link.active {
  color: var(--color-accent);
  background: rgba(34, 211, 238, 0.08);
}

.nav-link-icon {
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

/* =============================================
   Status Badges
   ============================================= */

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid;
}

.status-pending  { background: rgba(100,116,139,0.15); color: #94a3b8; border-color: rgba(100,116,139,0.3); }
.status-running  { background: rgba(34,211,238,0.1);  color: #22d3ee; border-color: rgba(34,211,238,0.25); }
.status-paused   { background: rgba(245,158,11,0.1);  color: #f59e0b; border-color: rgba(245,158,11,0.25); }
.status-completed{ background: rgba(16,185,129,0.1);  color: #10b981; border-color: rgba(16,185,129,0.25); }
.status-failed   { background: rgba(239,68,68,0.1);   color: #f87171; border-color: rgba(239,68,68,0.25); }
.status-cancelled{ background: rgba(51,65,85,0.5);    color: #64748b; border-color: rgba(51,65,85,0.5);   }

/* =============================================
   Buttons
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--color-accent);
  color: #020617;
}
.btn-primary:hover:not(:disabled) { background: #67e8f9; }

.btn-secondary {
  background: #1e293b;
  color: #e2e8f0;
}
.btn-secondary:hover:not(:disabled) { background: #334155; }

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: #f87171;
  border-color: rgba(239,68,68,0.2);
}
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,0.2); }

/* =============================================
   Cards
   ============================================= */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.card-body {
  padding: 1.25rem 1.5rem;
}

/* =============================================
   Form Inputs
   ============================================= */

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 0.625rem 1rem;
  color: #e2e8f0;
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder { color: #475569; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.form-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.5rem;
}

/* =============================================
   Loading / Spinner
   ============================================= */

.loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid transparent;
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* =============================================
   Progress Bar
   ============================================= */

.progress-bar-track {
  height: 6px;
  background: #1e293b;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* =============================================
   Notifications
   ============================================= */

#notification-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 22rem;
  pointer-events: none;
}

#notification-container > * {
  pointer-events: all;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(0.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fade-in-up 0.2s ease forwards;
}

/* =============================================
   Table
   ============================================= */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead tr {
  background: rgba(30,41,59,0.8);
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  white-space: nowrap;
}

.data-table td {
  padding: 0.875rem 1rem;
  color: #94a3b8;
  vertical-align: middle;
}

.data-table tbody tr {
  border-top: 1px solid rgba(30,41,59,0.6);
  transition: background 0.1s;
}

.data-table tbody tr:hover { background: rgba(30,41,59,0.4); }

/* =============================================
   Modal Overlay
   ============================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fade-in-up 0.15s ease;
}

.modal-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1.25rem;
  width: 100%;
  max-width: 36rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}

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

.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* =============================================
   Install page specific
   ============================================= */

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: rgba(30,41,59,0.5);
  margin-bottom: 0.5rem;
}

/* =============================================
   Log level colors (used in migration logs)
   ============================================= */

.log-info    { background: rgba(30,41,59,0.6);   border: 1px solid rgba(30,41,59,0.8);  }
.log-success { background: rgba(16,185,129,0.06); border: 1px solid rgba(16,185,129,0.15); }
.log-warning { background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.15); }
.log-error   { background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.15);  }

/* =============================================
   Responsive tweaks
   ============================================= */

@media (max-width: 768px) {
  .sidebar {
    display: none; /* Hide sidebar on mobile (could add hamburger toggle) */
  }
  .main-content {
    width: 100%;
  }
  #notification-container {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}

/* =============================================
   Utility: Hidden
   ============================================= */

.hidden { display: none !important; }
