/* =========================
   Layout / Container
========================= */
.election-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    max-width: 1200px;
    margin: auto;
    padding: 40px 20px;
}

.fixed-width {
    max-width: 1182px;
    margin: 0 auto;
    padding: 0 12px;
}

body {
    background-color: #051628;
}

.election-title i {
  margin-right: 8px;
  color: #2c7be5; /* optional color */
}


/* =========================
   Home Page
========================= */

.top-card {
  background-color: transparent !important;
}

.container {
    position: relative;
    z-index: 1;
}


.dashboard-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    background: #ffffff;
}

.dashboard-card .card-header {
    background: none;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

.election-item {
    padding: 12px 0;
    border-bottom: 1px solid #f1f1f1;
}

.election-item:last-child {
    border-bottom: none;
}

.title {
    font-weight: 500;
}

.date {
    font-size: 0.9rem;
    color: #777;
}

.timeline {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid #e5e5e5;
}

.timeline-year {
    font-weight: 600;
    margin-top: 15px;
}

.timeline-item {
    position: relative;
    margin: 10px 0;
}

.timeline-item .dot {
    position: absolute;
    left: -7px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: #0d6efd;
    border-radius: 50%;
}

.timeline-item .content {
    padding-left: 10px;
}

.election-btn {
    display: block;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: #f8f9fa;
    text-decoration: none;
    color: #000;
    transition: all 0.2s ease;
}

.election-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

body {
    background: linear-gradient(135deg, #0b1f3a 0%, #102a4c 100%);
    position: relative;
}



/* Keep content above pattern */
.container, .navbar {
    position: relative;
    z-index: 1;
}


/* =========================
   Race Card
========================= */
.race-card {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    width: 100%;
    position: relative;
}

.race-header {
    font-size: 30px;
    font-weight: 700;
    padding: 12px 16px;
    margin: -12px -12px 28px -12px;
    background: #2c3e50;
    color: white;
    border-bottom: 4px solid #d32f2f;
    border-radius: 8px 8px 0 0;
}

.race-card h2 {
    background-color: #003366;
    color: white;
    padding: 12px 20px;
    font-size: 1.8em;
    border-bottom: 4px solid red;
    margin-bottom: 16px;
    text-align: center;
    font-weight: bold;
    border-radius: 6px 6px 0 0;
}

.race-title {
    margin: 0;
}

/* =========================
   Candidate Row
========================= */
.candidate-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    gap: 10px;
}

.candidate-photo,
.winner-highlight {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.winner-highlight {
    border: 3px solid #28a745;
}

.candidate-info {
    flex: 1;
}

.candidate-name {
    font-weight: 600;
    font-size: 14px;
}

.party-name {
    font-size: 0.7rem;
    color: #333;
}

.special-votes {
    font-size: 0.8rem;
}

.incumbent-icon {
    display: inline-block;
    background-color: #ffc107; /* gold */
    color: #fff;
    font-weight: bold;
    width: 18px;
    height: 18px;
    text-align: center;
    border-radius: 50%;
    font-size: 0.75em;
    line-height: 18px;
    margin-left: 5px;
    vertical-align: middle;
}

/* =========================
   Vote Bars
========================= */
.vote-bar-container {
    width: 100%;
    height: 10px;
    background: #e5e5e5;
    border-radius: 4px;
    margin: 4px 0;
}

.vote-bar {
    height: 100%;
    border-radius: 4px;
}

/* Final (deduplicated) colors */
.vote-bar.red { background: rgb(255, 0, 0); }
.vote-bar.blue { background: rgb(0, 0, 255); }
.vote-bar.yellow { background: rgb(255, 255, 0); }
.vote-bar.purple { background: rgb(128, 0, 128); }
.vote-bar.green { background: rgb(0, 255, 0); }
.vote-bar.cyan { background: rgb(0, 255, 255); }
.vote-bar.orange { background: rgb(255, 165, 0); }
.vote-bar.brown { background: rgb(139, 69, 19); }

/* =========================
   Percent / Totals
========================= */
.percentage-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3px;
}

.percentage-text {
    font-size: 13px;
    color: #555;
}

.vote-breakdown {
    margin-top: 2px;
    font-size: 0.8rem;
    color: #555;
}

.total-votes {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.votes-ahead {
    font-size: 12px;
    font-weight: 600;
    color: #2e7d32;
}

/* =========================
   Winner Styles
========================= */
.winner-badge {
    background: #87ed88;
    color: #000;
    font-weight: bold;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 4px;
    margin-left: 8px;
}

.winner-container {
    background-color: #d4edda;
    border-radius: 6px;
    padding: 6px;
    margin-top: 4px;
}

.completed {
    background-color: #d4edda;
    font-weight: bold;
}

/* =========================
   Layout Split (Map + Results)
========================= */
.race-content {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.results-side {
    flex: 1.1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.map-side {
    flex: 1.3;
}

.map-side .race-map {
    margin-top: -20px;
}

/* =========================
   Map
========================= */
.race-map {
    height: 900px;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
}

.precinct-label {
    font-size: 10px;
    font-weight: bold;
    color: #000;
    background: rgba(255,255,255,0.7);
    padding: 2px 3px;
}

/* Leaflet fix */
.leaflet-popup-tip {
    display: none;
}

/* =========================
   Map Popup Layout
========================= */
.map-popup-container {
    display: flex;
    gap: 16px;
    position: relative;
}

.map-popup-container .race-map {
    flex: 2;
    height: 400px;
}

.floating-popup {
    position: absolute;
    top: 0;
    left: 0;
    width: 220px;
    padding: 10px;
    border: 2px solid #333;
    border-radius: 6px;
    background: #fff;
    display: none;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    pointer-events: auto;
    font-size: 13px;
    line-height: 1.3; 
}

.map-popup-container .floating-popup {
    flex: 1;
    max-height: 400px;
    overflow-y: auto;
    border-color: #d32f2f;
}

/* =========================
   Buttons
========================= */
.race-entry-btn {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 24px;
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: #28a745;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.race-entry-btn:hover {
    background: #218838;
    cursor: pointer;
}

.fas.fa-plus {
    font-size: 12px;
}

/* =========================
   Navbar
========================= */
.election-navbar {
    background: black;
    border-bottom: 4px solid #d32f2f;
}

.election-navbar .navbar-brand {
    color: #fff !important;
    font-size: 20px;
    font-weight: 700;
}

.election-navbar .nav-link {
    color: #fff !important;
    font-weight: 500;
    margin-left: 20px;
    transition: 0.2s;
}

.election-navbar .nav-link:hover {
    color: #d32f2f !important;
}

.admin-link {
    background: #28a745;
    color: white !important;
    padding: 6px 12px;
    border-radius: 5px;
}

.admin-link:hover {
    background: #218838;
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.3);
}

.navbar-toggler-icon {
    filter: invert(1);
}

/* =========================
   Misc
========================= */
.election-title {
    text-align: center;
    color: white;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 30px;
}

/* Color shades */
.red-1 { background:#8B0000; }
.red-2 { background:#B22222; }
.red-3 { background:#DC143C; }
.red-4 { background:#FF4C4C; }

.blue-1 { background:#00008B; }
.blue-2 { background:#1E3A8A; }
.blue-3 { background:#2563EB; }
.blue-4 { background:#60A5FA; }

.shade-1 { filter: brightness(0.75); }
.shade-2 { filter: brightness(0.9); }
.shade-3 { filter: brightness(1.05); }
.shade-4 { filter: brightness(1.2); }
.shade-5 { filter: brightness(1.35); }



.card {
    border: none;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.card a {
    text-decoration: none;
    font-weight: 500;
}

.card a:hover {
    text-decoration: underline;
}



.btn-primary {
    background-color: #2c3e50;
    border: none;
}

.btn-primary:hover {
    background-color: #1a252f;
}

.card-header {
    background-color: #2c3e50;
    color: white;
}

.form-control:focus {
    border-color: #2c3e50;
    box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.25);
}