/* ISC Content App — Mobile-first styles — Futuristic Dark Theme */

/* ===== GOOGLE FONTS IMPORT ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  /* Core backgrounds — backward compat names */
  --color-bg: #050510;
  --color-surface: rgba(15, 15, 35, 0.7);
  --color-surface-hover: rgba(20, 20, 50, 0.85);

  /* Primary accent — backward compat (was red #e94560, now indigo) */
  --color-primary: #6366f1;
  --color-primary-hover: #818cf8;
  --color-accent: #8b5cf6;

  /* Text — backward compat */
  --color-text: #f0f0ff;
  --color-text-muted: rgba(240, 240, 255, 0.55);
  --color-border: rgba(255, 255, 255, 0.07);

  /* Status colors */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #f43f5e;

  /* ISC content types */
  --color-servire: #10b981;
  --color-autenticitate: #3b82f6;
  --color-transformare: #a855f7;
  --color-invitatie: #f43f5e;

  /* New futuristic variables */
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --glow-1: rgba(99, 102, 241, 0.4);
  --glow-2: rgba(139, 92, 246, 0.3);
  --accent-1: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #a78bfa;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Shape & motion */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --transition: 0.2s ease;
}

/* ===== RESET ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== BASE BODY ===== */
body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Grid background pattern on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 10%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 10%, transparent 100%);
  pointer-events: none;
}

/* Ambient glow orbs on body */
body::after {
  content: '';
  position: fixed;
  top: -200px;
  left: -150px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: var(--accent-1);
  filter: blur(140px);
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
  animation: floatOrb 22s ease-in-out infinite;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.05); }
  66% { transform: translate(-25px, 25px) scale(0.95); }
}

/* ===== APP CONTAINER ===== */
#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

/* ===== TYPOGRAPHY ===== */
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.025em;
  color: var(--color-text);
}

h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-text);
}

p {
  color: var(--color-text-muted);
  margin-bottom: 12px;
  line-height: 1.65;
}

a {
  color: var(--accent-3);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-text);
}

code, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Shimmer effect for buttons */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover::after {
  opacity: 1;
}

/* Primary button — indigo gradient + glow */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  box-shadow: 0 0 20px var(--glow-1), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  box-shadow: 0 0 32px var(--glow-1), 0 0 64px var(--glow-2), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 0 16px var(--glow-1);
}

/* Secondary button — glass style */
.btn-secondary {
  background: var(--glass);
  color: var(--color-text);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid transparent;
  backdrop-filter: none;
}

.btn-ghost:hover {
  background: var(--glass);
  color: var(--color-text);
  border-color: var(--glass-border);
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 15, 35, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: 0.9375rem;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="number"]::placeholder,
textarea::placeholder {
  color: rgba(240, 240, 255, 0.3);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 0 20px rgba(99, 102, 241, 0.1);
  background: rgba(20, 20, 50, 0.7);
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

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

select option {
  background: #0d0d25;
  color: var(--color-text);
}

/* .input class used by some views */
.input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 15, 35, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: 0.9375rem;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.input::placeholder {
  color: rgba(240, 240, 255, 0.3);
}

.input:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 0 20px rgba(99, 102, 241, 0.1);
  background: rgba(20, 20, 50, 0.7);
}

textarea.input {
  min-height: 80px;
  resize: vertical;
}

/* Form labels & errors */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.form-error {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(244, 63, 94, 0.1);
  color: var(--color-error);
  font-size: 0.8125rem;
  margin-bottom: 8px;
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-left: 3px solid var(--color-error);
}

/* ===== CARDS ===== */
.card {
  background: rgba(15, 15, 35, 0.6);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.25s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(20, 20, 50, 0.75);
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ISC type badges */
.badge-servire {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-servire);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-autenticitate {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-autenticitate);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-transformare {
  background: rgba(168, 85, 247, 0.15);
  color: var(--color-transformare);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.badge-invitatie {
  background: rgba(244, 63, 94, 0.15);
  color: var(--color-invitatie);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

/* Status badges */
.badge-generating {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
  animation: pulseBadge 2s ease-in-out infinite;
}

@keyframes pulseBadge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.badge-info {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-3);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-posted {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--accent-1) 180deg,
    var(--accent-2) 270deg,
    transparent 360deg
  );
  animation: spin 0.8s linear infinite;
  position: relative;
}

.spinner::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--color-bg);
}

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

/* ===== RESPONSIVE: TABLET+ ===== */
@media (min-width: 768px) {
  #app {
    max-width: 640px;
    padding: 24px;
  }
}

@media (min-width: 1024px) {
  #app {
    max-width: 800px;
    padding: 32px;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
