/* === TYPOGRAPHY === */

:root {
  --primary: #000091;
  --danger: #e1000f;
  --secondary: #69707f;
  --bg: #f9faff;
  --white: #ffffff;
  --success: #008941;
  --warning: #d64d00;
  --text: #1e1e1e;
  --text-light: #666666;
  --border: #e5e5e5;
  --card-shadow: 0 10px 40px rgba(0, 0, 145, 0.15);
  --radius: 12px;
  --radius-lg: 20px;
  --feed-dark: #0a0a0a;
  --nav-height: 56px;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100%;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* === SCREENS === */
.screen {
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: var(--bg);
  overflow-y: auto;
}
.screen.active {
  display: flex;
}

/* When bottom nav is visible, screens need padding */
.screen.has-nav {
  padding-bottom: var(--nav-height);
}

/* === HEADER === */
.app-header {
  text-align: center;
  padding-bottom: 2rem;
}

.header-band {
  height: 6px;
  background: linear-gradient(90deg, var(--primary) 33%, var(--white) 33%, var(--white) 66%, var(--danger) 66%);
}

.header-content {
  padding: 2rem 1.5rem 0;
}

.app-logo-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.app-title {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.app-title .highlight {
  color: var(--primary);
}

.app-subtitle {
  font-size: 1.1rem;
  color: var(--secondary);
  font-weight: 400;
}

/* === WELCOME === */
.welcome-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.welcome-message {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.welcome-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.welcome-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
.step-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* === WELCOME MODE CARDS === */
.welcome-modes {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem 1.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  text-align: center;
}
.mode-card:hover {
  border-color: var(--primary);
  box-shadow: var(--card-shadow);
}
.mode-card:active {
  transform: scale(0.97);
}
.mode-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}
.mode-label {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.mode-desc {
  font-size: 0.9rem;
  color: var(--secondary);
  line-height: 1.4;
}

/* === BUTTONS === */
.btn-primary {
  display: block;
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: auto;
}
.btn-primary:hover {
  background: #1212ff;
}
.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 1rem;
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.btn-back {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--primary);
  font-weight: 700;
}

.legal-note {
  font-size: 0.75rem;
  color: var(--secondary);
  text-align: center;
  margin-top: 1.5rem;
  line-height: 1.5;
}

/* === SCREEN HEADER === */
.screen-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.screen-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

/* === LOCATION === */
.location-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.form-group select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23000091' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  cursor: pointer;
}
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.info-text {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.choice-buttons {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.btn-choice {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.2s;
}
.btn-choice:hover, .btn-choice.selected {
  border-color: var(--primary);
  background: rgba(0, 0, 145, 0.03);
}
.choice-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.choice-desc {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-top: 0.25rem;
}

.arrondissement-choice {
  margin-bottom: 1rem;
}

/* === LOADING === */
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1.5rem;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-content h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.loading-content p {
  color: var(--secondary);
}

/* === SWIPE === */
.swipe-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--danger));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--secondary);
  min-width: 3rem;
  text-align: right;
}

.swipe-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow: hidden;
}

.card-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  perspective: 1000px;
}

.swipe-card {
  width: 100%;
  max-width: 360px;
  min-height: 280px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.1s ease;
  will-change: transform;
}
.swipe-card.dragging {
  transition: none;
}
.swipe-card.animate-out {
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}

.card-theme {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(0, 0, 145, 0.08);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.card-statement {
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 400;
  color: var(--text);
}

.card-hint {
  position: absolute;
  top: 1rem;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.card-hint.show-for {
  right: 1rem;
  color: var(--success);
  background: rgba(0, 137, 65, 0.1);
  border: 2px solid var(--success);
  opacity: 1;
}
.card-hint.show-for::after { content: 'POUR'; }
.card-hint.show-against {
  left: 1rem;
  color: var(--danger);
  background: rgba(225, 0, 15, 0.1);
  border: 2px solid var(--danger);
  opacity: 1;
}
.card-hint.show-against::after { content: 'CONTRE'; }
.card-hint.show-priority {
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--warning);
  background: rgba(214, 77, 0, 0.1);
  border: 2px solid var(--warning);
  opacity: 1;
}
.card-hint.show-priority::after { content: 'PRIORITAIRE'; }
.card-hint.show-skip {
  bottom: 1rem;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  color: var(--secondary);
  background: rgba(105, 112, 127, 0.1);
  border: 2px solid var(--secondary);
  opacity: 1;
}
.card-hint.show-skip::after { content: 'INDIFFÉRENT'; }

/* Swipe buttons */
.swipe-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
}

.swipe-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--white);
  transition: transform 0.15s, background 0.15s;
}
.swipe-btn:active {
  transform: scale(0.9);
}

.btn-against {
  border-color: var(--danger);
  color: var(--danger);
}
.btn-against:hover {
  background: var(--danger);
  color: var(--white);
}

.btn-for {
  border-color: var(--success);
  color: var(--success);
}
.btn-for:hover {
  background: var(--success);
  color: var(--white);
}

.btn-skip {
  border-color: var(--secondary);
  color: var(--secondary);
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  align-self: center;
}
.btn-skip:hover {
  background: var(--secondary);
  color: var(--white);
}

.btn-priority {
  border-color: var(--warning);
  color: var(--warning);
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  align-self: center;
}
.btn-priority:hover {
  background: var(--warning);
  color: var(--white);
}

/* === RESULTS === */
.results-content {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
}

.result-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 2px solid var(--border);
  position: relative;
  overflow: hidden;
}
.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}
.result-card:nth-child(1)::before { background: #FFD700; }
.result-card:nth-child(2)::before { background: #C0C0C0; }
.result-card:nth-child(3)::before { background: #CD7F32; }
.result-card:nth-child(n+4)::before { background: var(--border); }

.result-rank {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  float: left;
  margin-right: 1rem;
  line-height: 1;
}

.result-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.result-party {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-bottom: 0.75rem;
}

.result-bar-container {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}
.result-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}
.result-bar.high { background: var(--success); }
.result-bar.medium { background: var(--warning); }
.result-bar.low { background: var(--danger); }

.result-score {
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}
.result-score.high { color: var(--success); }
.result-score.medium { color: var(--warning); }
.result-score.low { color: var(--danger); }

.result-pdf-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: underline;
}

.results-actions {
  margin-top: 1.5rem;
}

.btn-share {
  display: block;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, #6929c4 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  margin-bottom: 0.75rem;
}
.btn-share:hover {
  opacity: 0.9;
}
.btn-share:active {
  transform: scale(0.98);
}

/* === DETAILS === */
.details-content {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
}

.detail-candidate {
  margin-bottom: 2rem;
}
.detail-candidate-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}
.detail-candidate-rank {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}
.detail-candidate-name {
  font-size: 1.1rem;
  font-weight: 700;
}
.detail-candidate-score {
  margin-left: auto;
  font-size: 1.1rem;
  font-weight: 700;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.detail-icon {
  flex-shrink: 0;
  font-size: 1rem;
}
.detail-icon.agree { color: var(--success); }
.detail-icon.disagree { color: var(--danger); }
.detail-icon.skip { color: var(--secondary); }
.detail-icon.priority { color: var(--warning); }

.detail-statement {
  flex: 1;
  line-height: 1.4;
}

/* ================================================
   BOTTOM NAVIGATION BAR
   ================================================ */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}

.bottom-nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--secondary);
  transition: color 0.2s;
  padding: 0.4rem 0;
}
.bottom-nav-tab.active {
  color: var(--primary);
}
.bottom-nav-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.bottom-nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ================================================
   FEED (TikTok-style) SCREEN
   ================================================ */
#screen-feed {
  background: var(--feed-dark);
  overflow: hidden;
}
#screen-feed.has-nav {
  padding-bottom: var(--nav-height);
}

/* --- Filter bar --- */
.feed-filter-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
  padding: 0.6rem 0 1.2rem;
}
.feed-filter-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.feed-filter-scroll::-webkit-scrollbar { display: none; }

.feed-pill {
  flex-shrink: 0;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.feed-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.feed-pill:not(.active):hover {
  background: rgba(255,255,255,0.2);
}

/* Separator pill style for theme vs candidate */
.feed-pill.separator {
  border: none;
  background: none;
  color: rgba(255,255,255,0.3);
  padding: 0.4rem 0.2rem;
  cursor: default;
  font-size: 1rem;
}

/* --- Desktop navigation hint --- */
.feed-desktop-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
  animation: hintFadeIn 0.4s ease;
  transition: opacity 0.4s ease;
}
.feed-desktop-hint.hiding {
  opacity: 0;
}
.hint-keys {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  font-size: 0.85rem;
  margin: 0 0.15rem;
  vertical-align: middle;
}
@keyframes hintFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* --- Feed container (snap scroll) --- */
.feed-container {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.feed-container::-webkit-scrollbar { display: none; }

/* --- Individual slide --- */
.feed-slide {
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  flex-shrink: 0;
}

/* Background gradient (placeholder for PDF thumbnail) */
.feed-slide-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(4px) brightness(0.5);
  transform: scale(1.3);
  transition: transform 0.8s ease-out, filter 0.8s ease-out;
}

/* Parallax-like effect on active slide */
.feed-slide.in-view .feed-slide-bg {
  transform: scale(1.05);
  filter: blur(2px) brightness(0.45);
}

/* Dark overlay gradient */
.feed-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    0deg,
    rgba(0,0,0,0.7) 0%,
    rgba(0,0,0,0.15) 35%,
    rgba(0,0,0,0.05) 60%,
    rgba(0,0,0,0.3) 100%
  );
  pointer-events: none;
}

/* --- Slide content overlay --- */
.feed-slide-content {
  position: relative;
  z-index: 2;
  padding: 1.5rem;
  padding-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Candidate name at top */
.feed-candidate-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin-top: 3.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.feed-candidate-name:active {
  opacity: 0.7;
}

.feed-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.3);
}

/* Center: the proposal statement */
.feed-statement-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}
.feed-statement {
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6), 0 1px 4px rgba(0,0,0,0.4);
  text-align: center;
  max-width: 95%;
}

/* Bottom info: theme badge */
.feed-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.feed-bottom-left {
  flex: 1;
  min-width: 0;
}

.feed-theme-badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  background: rgba(0,0,145,0.6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  margin-bottom: 0.5rem;
}

.feed-candidate-list-name {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Right side: vertical action icons (TikTok-like) */
.feed-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  flex-shrink: 0;
}

.feed-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  font-family: inherit;
  transition: transform 0.15s;
}
.feed-action-btn:active {
  transform: scale(0.85);
}
.feed-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.feed-action-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.7;
}

.feed-action-btn.bookmarked .feed-action-icon {
  background: rgba(0,0,145,0.5);
  color: #fff;
}

/* --- Slide counter --- */
.feed-counter {
  position: absolute;
  top: 0.65rem;
  right: 1rem;
  z-index: 25;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.04em;
}

/* ================================================
   FEED CANDIDATE DETAIL SCREEN
   ================================================ */
.feed-cand-header {
  background: var(--white);
}
.feed-cand-header .btn-back {
  color: var(--primary);
}

.feed-cand-content {
  padding: 1rem 1.5rem 2rem;
  flex: 1;
  overflow-y: auto;
}

.feed-cand-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.feed-cand-avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.feed-cand-meta-text {
  flex: 1;
  min-width: 0;
}
.feed-cand-meta-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.feed-cand-meta-count {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-top: 0.15rem;
}
.feed-cand-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.feed-cand-proposal {
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
.feed-cand-proposal-theme {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(0,0,145,0.08);
  color: var(--primary);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.feed-cand-proposal-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

/* ================================================
   DATA WARNING BANNERS
   ================================================ */
/* Shared warning styles */
.data-warning,
.feed-warning-bar {
  background: #fff3cd;
  color: #664d03;
  font-size: 0.8rem;
  line-height: 1.45;
  overflow: hidden;
}

.data-warning {
  border-bottom: 1px solid #ffc107;
}

/* Feed version: positioned at top under filter bar */
.feed-warning-bar {
  position: absolute;
  top: 2.8rem;
  left: 0;
  right: 0;
  z-index: 19;
  background: rgba(255, 243, 205, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.75rem;
}

/* Header: always visible, clickable */
.warning-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 700;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.warning-header:active {
  opacity: 0.7;
}

.warning-chevron {
  font-size: 0.6rem;
  transition: transform 0.3s ease;
}

.expanded .warning-chevron {
  transform: rotate(180deg);
}

/* Body: hidden by default, slides down */
.warning-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 1rem;
  text-align: center;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.expanded .warning-body {
  max-height: 200px;
  padding: 0 1rem 0.6rem;
}

/* ================================================
   PROGRAMMES SCREEN
   ================================================ */
.programmes-content {
  padding: 1rem 1.5rem 1rem;
  flex: 1;
  overflow-y: auto;
}
.programmes-content::after {
  content: '';
  display: block;
  height: calc(var(--nav-height) + 3rem);
}

.programme-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.programme-card:active {
  transform: scale(0.98);
}
.programme-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,145,0.1);
}

.programme-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.programme-info {
  flex: 1;
  min-width: 0;
}
.programme-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.programme-meta {
  font-size: 0.8rem;
  color: var(--secondary);
}

.programme-action {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.programme-no-data {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--secondary);
}
.programme-no-data strong {
  display: block;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.programme-card-wrap {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.programme-card-wrap:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,145,0.1);
}
.programme-card-wrap .programme-card {
  border: none;
  margin-bottom: 0;
  border-radius: 0;
  cursor: pointer;
}

.programme-chevron {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--secondary);
  transition: transform 0.3s;
  margin-right: 0.5rem;
}
.programme-card-wrap.expanded .programme-chevron {
  transform: rotate(180deg);
}

.programme-proposals {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows 0.4s ease;
}
.programme-proposals > * {
  overflow: hidden;
}
.programme-card-wrap.expanded .programme-proposals {
  grid-template-rows: 1fr;
}

.programme-proposal-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
}
.programme-proposal-item:last-child {
  padding-bottom: 0.8rem;
}

.programme-proposal-theme {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.programme-proposal-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
}

/* ================================================
   SETTINGS SCREEN
   ================================================ */
.settings-content {
  padding: 1.5rem;
  flex: 1;
}

.settings-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.settings-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.settings-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.settings-content .btn-secondary {
  margin-bottom: 0;
}

/* === ANIMATIONS === */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.screen.slide-in {
  animation: slideIn 0.3s ease forwards;
}
.screen.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* === RESPONSIVE === */
@media (min-width: 481px) {
  #app {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

@media (max-height: 600px) {
  .swipe-card {
    min-height: 200px;
    padding: 1.5rem;
  }
  .card-statement {
    font-size: 1.1rem;
  }
  .feed-statement {
    font-size: 1.2rem;
  }
}

/* ================================================
   COOKIE CONSENT BANNER
   ================================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--white);
  border-top: 2px solid var(--primary);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  padding: 1.25rem 1.5rem;
  display: none;
}
.cookie-banner.visible {
  display: block;
}
.cookie-banner-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 1rem;
}
.cookie-banner-text a {
  color: var(--primary);
  text-decoration: underline;
}
.cookie-banner-buttons {
  display: flex;
  gap: 0.75rem;
}
.cookie-banner-buttons button {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.cookie-btn-accept {
  background: var(--primary);
  color: var(--white);
}
.cookie-btn-refuse {
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--border) !important;
}

/* ================================================
   LEGAL / PRIVACY SCREENS
   ================================================ */
.legal-content {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
}
.legal-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.legal-content h3:first-child {
  margin-top: 0;
}
.legal-content p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.legal-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.5rem;
}
.legal-links button {
  background: none;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
}
