/* ============================================
   CSS Minifier — Full Screen Styles
   ============================================ */
:root {
  --bg-deep: #0b0f19;
  --bg-surface: rgba(255,255,255,0.035);
  --bg-card: rgba(255,255,255,0.03);
  --glass-border: rgba(255,255,255,0.08);
  --text-main: #e8e8f0;
  --text-muted: #8899aa;
  --accent: #22d3ee;
  --accent-soft: #67e8f9;
  --accent-glow: rgba(34,211,238,0.35);
  --radius: 22px;
  --radius-sm: 14px;
  --transition: 0.2s ease;
}

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

html, body {
  height: 100%; width: 100%; overflow: hidden;
  background: var(--bg-deep); color: var(--text-main);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
}

body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(at 15% 20%, rgba(34,211,238,0.18) 0%, transparent 55%),
    radial-gradient(at 85% 30%, rgba(103,232,249,0.1) 0%, transparent 50%),
    radial-gradient(at 50% 85%, rgba(34,211,238,0.12) 0%, transparent 55%),
    radial-gradient(at 90% 75%, rgba(103,232,249,0.08) 0%, transparent 45%);
  animation: meshMove 30s ease-in-out infinite alternate;
}

@keyframes meshMove {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-15px, 10px) scale(1.05); }
}

#app {
  position: relative; z-index: 1;
  height: 100vh; width: 100vw;
  display: flex; flex-direction: column; overflow: hidden;
}

/* Header */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 36px 14px; gap: 24px; flex-shrink: 0;
}

.logo-wrap { display: flex; align-items: center; gap: 16px; }
.logo-icon { width: 52px; height: 52px; flex-shrink: 0; filter: drop-shadow(0 0 12px var(--accent-glow)); }

.logo-wrap h1 {
  font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
  background: linear-gradient(135deg, #fff 40%, var(--accent-soft));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.tagline { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

.header-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.meta-badge {
  background: var(--bg-card); border: 1px solid var(--glass-border);
  color: var(--text-muted); padding: 6px 14px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

/* Main */
.main {
  flex: 1 1 auto; overflow: hidden;
  padding: 0 36px 36px; display: grid; grid-template-columns: 1fr 1fr 340px; gap: 24px; align-items: stretch;
}

/* Editor */
.editor-panel { display: flex; flex-direction: column; gap: 18px; min-height: 0; overflow: hidden; }

.panel-header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.panel-header-row h2 { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; }

#inputCSS {
  flex: 1 1 auto; resize: none; min-height: 0;
  padding: 18px 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border); background: rgba(255,255,255,0.02);
  color: var(--text-main); font-size: 0.85rem; line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}

#inputCSS:focus { border-color: rgba(34,211,238,0.5); box-shadow: 0 0 0 3px rgba(34,211,238,0.1); }

/* Action row */
.action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn-small, .btn-primary, .btn-secondary, .btn-accent {
  border: none; border-radius: 14px; padding: 10px 20px; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: transform 0.12s ease, box-shadow 0.2s ease; display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
  color: #062e22; box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(34,211,238,0.45); }

.btn-secondary {
  background: var(--bg-surface); color: var(--text-main); border: 1px solid var(--glass-border);
}
.btn-secondary:hover { background: var(--bg-card); border-color: rgba(255,255,255,0.2); }

.btn-accent {
  background: linear-gradient(135deg, #22d3ee 0%, #67e8f9 100%);
  color: #062e22; box-shadow: 0 8px 24px rgba(34,211,238,0.35);
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(34,211,238,0.45); }

/* Results */
.results-card {
  background: var(--bg-card); border: 1px solid var(--glass-border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.results-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0;
}

.results-header h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }

.stats { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }

#outputCSS {
  flex: 1 1 auto; resize: none; min-height: 0;
  padding: 16px 24px; border: none; background: transparent;
  color: var(--text-main); font-size: 0.85rem; line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  outline: none; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
#outputCSS::-webkit-scrollbar { width: 6px; }
#outputCSS::-webkit-scrollbar-track { background: transparent; }
#outputCSS::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }

/* Metrics */
.metrics-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 10px;
}

.metric-box {
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 16px 12px; text-align: center; transition: border-color 0.2s, box-shadow 0.2s;
}

.metric-box:hover { border-color: rgba(34,211,238,0.3); box-shadow: 0 0 0 2px rgba(34,211,238,0.08); }

.metric-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.metric-value { font-size: 1.1rem; font-weight: 800; color: var(--text-main); margin-top: 6px; }

.metric-box.highlight { border-color: rgba(34,211,238,0.3); background: linear-gradient(135deg, rgba(34,211,238,0.06) 0%, rgba(34,211,238,0.03) 100%); }
.metric-box.highlight .metric-value { color: var(--accent-soft); }

/* Download */
.download-card {
  background: linear-gradient(135deg, rgba(34,211,238,0.06) 0%, rgba(34,211,238,0.03) 100%);
  border: 1px solid rgba(34,211,238,0.15); border-radius: var(--radius);
  padding: 20px 22px;
}
.download-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.01em; }
.download-card p { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 14px; }

.btn-download {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 14px; padding: 12px 24px;
  font-size: 0.92rem; font-weight: 700; cursor: pointer;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
  color: #062e22; box-shadow: 0 8px 24px var(--accent-glow);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.btn-download:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(34,211,238,0.45); }

/* Tip */
.tip-card {
  background: linear-gradient(135deg, rgba(34,211,238,0.06) 0%, rgba(34,211,238,0.03) 100%);
  border: 1px solid rgba(34,211,238,0.15); border-radius: var(--radius);
  padding: 18px 20px;
}
.tip-card h4 { font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; color: var(--accent-soft); }
.tip-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }

/* Footer */
.footer { padding: 8px 36px 16px; text-align: center; font-size: 0.78rem; color: var(--text-muted); flex-shrink: 0; }

/* Responsive */
@media (max-width: 1020px) {
  .main { grid-template-columns: 1fr; }
  .side-panel { overflow-y: auto; max-height: 55vh; }
}

@media (max-width: 640px) {
  .header { padding: 18px 16px 10px; }
  .main { padding: 0 16px 24px; gap: 16px; }
  .logo-wrap h1 { font-size: 1.15rem; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .footer { padding: 8px 16px 12px; }
}
