:root {
  --bg: #0f1115;
  --card: #1c2129;
  --accent: #ff5252;
  --accent-grad: linear-gradient(135deg, #ff6a3d, #ff2a72);
  --text: #e5e9f0;
  --muted: #8892a0;
  --focus: #3d8bff;
  --border: #262d37;
  --radius: 14px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

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

body { background: var(--bg); color: var(--text); line-height: 1.45; min-height: 100vh; }

/* Layout */
header { padding: 1.2rem clamp(1rem, 3vw, 2.5rem); display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; justify-content: space-between; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 0.8rem; }
.brand img { width: 32px; height: 32px; border-radius: 6px; }
.brand h1 { font-size: 1.2rem; font-weight: 600; }
.user-info { display: flex; align-items: center; gap: 0.8rem; }

.btn { background: var(--accent-grad); border: none; color: white; padding: 0.6rem 1.2rem; border-radius: 6px; cursor: pointer; font-weight: 500; transition: all 0.2s ease; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255, 82, 82, 0.3); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-secondary { background: transparent; border: 1px solid var(--muted); color: var(--muted); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255, 82, 82, 0.2); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: all 0.2s ease; }
.card:hover { border-color: #3a4452; transform: translateY(-2px); }

/* Grid - Responsive layout */
.campaigns-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(360, 1fr)); margin: 2rem clamp(1rem, 3vw, 2.5rem); max-width: 1200px; margin: 0 auto; }
.campaigns-empty { margin: 2rem clamp(1rem, 3vw, 2.5rem); max-width: 1200px; min-height: 40vh; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto; }
@media (min-width: 1200) { .campaigns-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .campaigns-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .campaigns-grid { grid-template-columns: 1fr; padding:15px; } }

/* Campaign Cards */
.campaign-card { cursor: pointer; display: flex; flex-direction: column; height: 100%; text-decoration:none; }
.campaign-card:hover { border-color: var(--accent); }
.campaign-card.closed-campaign { opacity: 0.8; cursor: pointer; }
.campaign-card.closed-campaign:hover { border-color: var(--accent); transform: translateY(-2px); opacity: 0.9; }
.campaign-title { font-size: 1.3rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--text); }
.campaign-subtitle { color: var(--muted); margin: 0 0 1rem; font-size: 0.95rem; }
.campaign-description { color: var(--text); line-height: 1.5; margin: 0 0 1.5rem; flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* Campaign Photo Styles */
.campaign-photo { width: 100%; aspect-ratio: 16/9; margin-bottom: 1rem; border-radius: 8px; overflow: hidden; background: #262d37; position: relative; }
.campaign-image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.campaign-card:hover .campaign-image { transform: scale(1.05); }

/* Closed Campaign Overlay */
.closed-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.closed-badge { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); color: white; padding: 8px 16px; border-radius: 20px; font-weight: 600; font-size: 0.9rem; text-align: center; box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3); }

.campaign-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); gap: 0.5rem; flex-wrap: wrap; }
@media (max-width: 599px) { .campaign-footer { flex-direction: column; align-items: stretch; gap: 1rem; } }
.campaign-stats { font-size: 0.8rem; color: var(--muted); }

/* Leading Badge */
.leading-badge { position: absolute; top: 8px; right: 8px; background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%); color: #1a1a1a; padding: 4px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: 600; z-index: 10; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }

/* Leader Info Footer */
.leader-info-footer { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%); border-radius: 6px; padding: 12px 16px; color: #1a1a1a; min-width: 0; }
.leader-avatar-small { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.leader-photo-small { width: 100%; height: 100%; object-fit: cover; }
.leader-placeholder-small { width: 100%; height: 100%; background: #333; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 0.9rem; }
.leader-details-small { flex: 1; min-width: 0; }
.leader-name-small { font-weight: 600; font-size: 0.85rem; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leader-votes-small { font-size: 0.75rem; opacity: 0.8; }
.closed-date-small { font-size: 0.7rem; opacity: 0.7; margin-top: 2px; color: #dc3545; }
.elected-leader { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3); }

/* Prominent Stats */
.campaign-stats-prominent { display: flex; align-items: center; gap: 16px; background: rgba(255, 82, 82, 0.1); border: 1px solid rgba(255, 82, 82, 0.2); border-radius: 6px; padding: 12px 16px; }
.stat-item { text-align: center; }
.stat-number { font-size: 1.5rem; font-weight: 700; color: #cadafa; line-height: 1; }
.stat-label { font-size: 0.75rem; color: #9ca3af; margin-top: 2px; font-weight: 500; }
.stat-divider { color: #666; font-size: 1.2rem; opacity: 0.5; }

.enter-btn { padding: 0.5rem 1rem; font-size: 0.85rem; background: transparent; border: 1px solid var(--accent); color: var(--accent); transition: all 0.2s ease; }
.enter-btn:hover { background: var(--accent); color: white; }

/* Page Header */
.page-header { text-align: center; margin: 3rem clamp(1rem, 3vw, 2.5rem) 2rem; }
.page-title { font-size: 2.5rem; font-weight: 700; margin: 0 0 0.5rem; color: var(--text); }
.page-subtitle { color: var(--muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* Loading / Empty States */
.loading { text-align: center; padding: 3rem; color: var(--muted); }
.empty-state { text-align: center; color: var(--muted); padding: 3rem clamp(1rem, 3vw, 2.5rem); }
.empty-state h2 { margin-bottom: 1rem; color: var(--text); }

/* Footer */
footer { text-align: center; padding: 3rem 1rem 2rem; font-size: 0.7rem; color: #5a646f; margin-top: auto; }

/* Responsive */
@media (max-width: 599px) { header { flex-direction: column; align-items: flex-start; } .page-title { font-size: 2rem; } .page-header { margin: 2rem 1rem; } }
