/* 
    Master Procrastinator main style sheet
*/

:root {
  --bg: #0b1020;
  --surface: #111733;
  --surface-2: #0f1630;
  --text: #eaeaff;
  --link: #00f5d4;
  --muted: #a9b1d6;
  --primary: #7c3aed;
  --primary-500: #8b5cf6;
  --accent: #3b82f6;
  --ring: #a78bfa55;
  --card-shadow: 0 10px 30px #00000059;
  --border: #29304d;
} 

:root[data-theme="light"] {
  --bg: #f9f9fc;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --text: #1a1b26;
  --link: #0051ff;
  --muted: #5e627a;
  --primary: #6d28d9;
  --primary-500: #7c3aed;
  --accent: #2563eb;
  --ring: #6d28d959;
  --card-shadow: 0 4px 12px #00000014;
  --border: #d8dcee;
}

/* Light theme background override */
:root[data-theme="light"] body {
  background: radial-gradient(1000px 600px at 5% -5%, #e8eaff 0%, transparent 60%),
              radial-gradient(1000px 600px at 100% 10%, #eef2ff 0%, transparent 60%),
              var(--bg);
}

/* Light theme for headers, toolbar, and UI chrome */
:root[data-theme="light"] header,
:root[data-theme="light"] .toolbar,
:root[data-theme="light"] .modal,
:root[data-theme="light"] .file-upload,
:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select {
  background-color: var(--surface);
  color: var(--text);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
}

/* Inputs / text areas in light mode */
:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select {
  background-color: var(--surface-2);
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);              
}

header,
.toolbar,
.modal,
.file-upload {
  background-color: var(--surface);
  color: var(--text);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(140%) blur(4px);
  background: color-mix(in oklab, var(--bg) 15%, transparent);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  z-index: 50;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 1;
}
.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.3px;
}
.logo {
  width: 70px; height: 70px;
  padding: 0px 0px;
}

.small { padding: 6px 10px; font-size: 13px; }

.file-actions { display: flex; gap: 10px; align-items: center; }
.file-label input { display: none; }

/* Layout */
.container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 16px;
}
@media (max-width: 980px) {
  .container { grid-template-columns: 1fr; }
}

/* Panels */
.list-panel {
  background: color-mix(in oklab, var(--surface-2) 60%, transparent 40%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  overflow: clip;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface-2) 60%, transparent);
}
.panel-header h2 { margin: 0; font-size: 16px; letter-spacing: 0.3px; }
.panel-tools { display: flex; gap: 10px; align-items: center; }
.panel-tools input, .panel-tools select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
}

.attachment-preview {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px 8px;
}

.preview-card {
  gap: 6px; 
  width: 180px;
  border: 1px dashed var(--border); 
  border-radius: 12px; 
  padding: 8px;
  display: inline-flex;
  background: color-mix(in oklab, var(--surface) 85%, transparent);
  flex-direction: column;
  align-items: center;
  position: relative;
  margin: 4px;
}
.preview-card img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; }

/* Footer */
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text);
  font-size: 0.95rem;
  text-align: center;
}

footer a { color: var(--primary-500); text-decoration: none; }

.settings-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  color: var(--text);
  background: var(--ring);
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

/* presets grid */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.preset-tile {
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(255,255,255,0.04);
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:flex-start;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.00));
}

.preset-tile input[type="radio"] {
  margin-right: 8px;
  accent-color: var(--accent, #6ee7b7);
}

.preset-swatch {
  width: 100%;
  height: 40px;
  border-radius:6px;
  display:flex;
  gap:6px;
  overflow:hidden;
  border: 1px solid rgba(0,0,0,0.05);
}

/* preview area */
.preview-box {
  border-radius: 8px;
  padding: 12px;
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(255,255,255,0.00));
}

.preview-sample {
  display:flex;
  flex-direction:column;
  gap:8px;
}

.preview-sample h4 {
  margin:0;
  font-size:0.95rem;
}

.preview-text {
  margin:0;
  color: var(--muted, #8892a6);
  font-size:0.9rem;
}

.preview-btn {
  padding:6px 12px;
  border-radius:8px;
  border: none;
  cursor: pointer;
  background: var(--accent, #6ee7b7);
  color: var(--card-bg, #0b1220);
  font-weight: 600;
}

/* small controls column */
.editor-controls {
  min-width: 220px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

#theme-name {
  padding:8px;
  border-radius:8px;
  border: 1px solid rgba(255,255,255,0.04);
  background: transparent;
  color: var(--fg, #e6eef8);
}

.button-row {
    display: flex;
    flex-direction: row;
    gap: 2rem; 
    margin-top: 0.6rem; 
    margin-bottom: 1rem;
    align-self: center;
}

.import-export { 
    display: flex; 
    flex-direction: row; 
    gap: 2rem; 
    margin-bottom: 0.6rem;
    align-items: center; 
    align-self: center;
}

/* small divider */
.section-divider {
  height:1px;
  border: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
}

/* responsive */
@media (max-width:800px) {
  .preview-box { flex-direction:column; align-items:stretch; }
}

/* Helpful utility classes */
.hidden { display: none !important; }