/* PPG1 – Main Stylesheet */
:root {
  --primary: #003366;
  --secondary: #0066CC;
  --accent: #FF6600;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --danger: #dc3545;
  --success: #28a745;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

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

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ─── Navbar ─────────────────────────────────────────────── */
.navbar {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nav-brand { font-size: 1.4rem; font-weight: 700; margin-right: 2rem; }
.nav-brand span { color: var(--accent); }
.nav-links { list-style: none; display: flex; gap: 1rem; flex: 1; }
.nav-links a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.9rem; padding: 0.3rem 0.5rem; border-radius: 4px; }
.nav-links a.active, .nav-links a:hover { color: #fff; background: rgba(255,255,255,0.15); }
.nav-user { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; }

/* ─── Container ──────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.6rem; }

/* ─── Auth Page ───────────────────────────────────────────── */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, #0d47a1 100%);
}
.auth-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo h1 { font-size: 2.5rem; color: var(--primary); }
.auth-logo h1 span { color: var(--accent); }
.auth-logo p { color: var(--text-muted); font-size: 0.9rem; }
.auth-switch { text-align: center; margin-top: 1rem; font-size: 0.9rem; }
.auth-switch a { color: var(--secondary); }
.notice { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

/* ─── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 0.9rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: auto; }
.form-section { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.form-section h2 { font-size: 1.1rem; margin-bottom: 1rem; color: var(--primary); border-bottom: 2px solid var(--border); padding-bottom: 0.5rem; }
.form-actions { text-align: center; margin-top: 1rem; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--border);
  color: var(--text);
  transition: opacity 0.15s, transform 0.1s;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1rem; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: #fde8e8; color: var(--danger); border: 1px solid #f5c6cb; }
.alert-success { background: #e8f5e9; color: var(--success); border: 1px solid #c3e6cb; }
.hidden { display: none !important; }

/* ─── Presentation Grid ───────────────────────────────────── */
.pres-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.pres-card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); border-left: 4px solid var(--primary); }
.pres-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--text); }
.pres-card-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.pres-card-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.empty-state { color: var(--text-muted); padding: 2rem; text-align: center; }
.loading { color: var(--text-muted); padding: 2rem; text-align: center; }

/* ─── Slides Preview ─────────────────────────────────────── */
.pres-preview-title { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; padding: 1rem; background: var(--surface); border-radius: var(--radius); }
.slides-list { display: flex; flex-direction: column; gap: 0.75rem; }
.slide-preview { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); border-left: 3px solid var(--secondary); }
.slide-number { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.2rem; }
.slide-title { font-weight: 700; font-size: 1rem; color: var(--primary); margin-bottom: 0.5rem; }
.slide-bullets { margin-left: 1.2rem; color: var(--text); font-size: 0.9rem; }
.slide-bullets li { margin-bottom: 0.2rem; }
.slide-notes { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; font-style: italic; }
.slide-image-prompt { font-size: 0.8rem; color: #5c7a9e; margin-top: 0.3rem; }
.slide-diagram { font-size: 0.8rem; color: var(--accent); margin-top: 0.3rem; }
.slide-interactive { font-size: 0.8rem; color: var(--success); margin-top: 0.3rem; }
.export-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ─── Loading Overlay ────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  z-index: 999;
  color: #fff;
  font-size: 1.1rem;
  gap: 1rem;
}
.spinner {
  width: 50px; height: 50px;
  border: 5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Modal ──────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; justify-content: center; align-items: center;
  z-index: 500;
}
.modal-content {
  background: var(--surface);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-content h3 { margin-bottom: 1rem; color: var(--primary); }
.modal-content textarea { width: 100%; padding: 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); resize: vertical; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1rem; }

/* ─── Tables ─────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th { background: var(--primary); color: #fff; padding: 0.75rem 1rem; text-align: left; font-size: 0.85rem; }
.data-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table select { padding: 0.25rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; }

/* ─── Tabs ───────────────────────────────────────────────── */
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.tab-btn { padding: 0.5rem 1.2rem; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 600; color: var(--text-muted); }
.tab-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Create form ────────────────────────────────────────── */
.create-form { max-width: 860px; }
