/* TIMEASE — simple, couleurs vives */

:root {
  --bg: #2a1f5c;
  --bg-card: #3d2f7a;
  --border: #6b5cb3;
  --text: #faf8ff;
  --text-muted: #c4b8f0;
  --accent: #f43f5e;
  --accent-hover: #fb7185;
  --cyan: #06b6d4;
  --cyan-dark: #0891b2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --font: "SF Pro Text", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.app-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  z-index: 0;
  background-color: var(--bg);
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  max-width: 880px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(24px, 5vh, 48px) 20px clamp(32px, 6vh, 80px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 36px;
}

.hero-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid var(--cyan);
  background: var(--bg-card);
  margin-bottom: 16px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}

.hero-sub {
  margin: 0 auto;
  max-width: 520px;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.card-glass {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* Composer */
.composer {
  margin-bottom: 28px;
}

.composer-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.composer-input {
  width: 100%;
  min-height: 200px;
  padding: 18px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  background: #221a4a;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  transition: border-color 0.15s;
}

.composer-input::placeholder {
  color: var(--text-muted);
  opacity: 0.9;
}

.composer-input:focus {
  outline: none;
  border-color: var(--cyan);
}

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.status {
  flex: 1;
  min-height: 1.4em;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status.error {
  color: #fda4af;
}

.status.success {
  color: #86efac;
}

.btn-send {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s, transform 0.15s, opacity 0.2s;
}

.btn-send:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent-hover);
}

.btn-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-send.is-loading .btn-send-icon {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.4; }
}

.btn-send-icon {
  font-size: 1.1rem;
  line-height: 1;
}

/* Results */
.results {
  padding: 28px;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.results-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--cyan);
  border: 2px solid var(--cyan-dark);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.btn-download:hover {
  background: var(--cyan-dark);
  border-color: #0e7490;
  transform: translateY(-1px);
}

.btn-download-icon {
  font-size: 1rem;
  opacity: 0.95;
}

.meta-info {
  margin-bottom: 20px;
}

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  font-size: 0.875rem;
  background: #221a4a;
  border: 2px solid var(--border);
  border-radius: 999px;
}

.chip-key {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.timetable-wrap {
  overflow-x: auto;
  margin: 0 -8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: #221a4a;
  border: 2px solid var(--border);
}

.tt-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 0.8rem;
}

.tt-table th,
.tt-table td {
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 8px;
  text-align: center;
}

.tt-table th {
  background: #5b21b6;
  color: #fff;
  font-weight: 600;
}

.tt-slot {
  font-weight: 600;
  color: var(--text-muted);
  background: #2d2460;
}

td.empty {
  color: var(--text-muted);
  opacity: 0.55;
}

td.filled {
  font-weight: 500;
}

td.subject-color-0 { background: #2563eb; color: #eff6ff; }
td.subject-color-1 { background: #9333ea; color: #faf5ff; }
td.subject-color-2 { background: #16a34a; color: #f0fdf4; }
td.subject-color-3 { background: #ea580c; color: #fff7ed; }
td.subject-color-4 { background: #db2777; color: #fdf2f8; }
td.subject-color-5 { background: #0891b2; color: #ecfeff; }

.stats-heading {
  margin: 28px 0 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stats-wrap {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.stats-lead {
  margin: 0 0 12px;
  color: var(--text);
}

.stats-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.stats-list li {
  margin-bottom: 6px;
}

@media (max-width: 600px) {
  .app {
    padding: 32px 16px 60px;
  }

  .composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-send {
    justify-content: center;
  }
}
