@import url('https://fonts.googleapis.com/css2?family=Merriweather+Sans:wght@300;400;500;600&display=swap');

:root {
    --color-dark: #34425A;
    --text-grey: #B0B0B0;
    --bg-color: #F5F5F5;
        --button-color: #1B3764;
        --button-text-color: #FFFFFF;
        --second-bg-color: #323946;
        --text-color: #fff;
        --main-color: #1B3764;
        --input-field: #E0E0E0;
        --input-field-text: #000000;
        --header-background: #1B3764;
        --card-background: #E0E0E0;
}

* {
    margin: 0;
    padding: 0;
    text-decoration: none;
    list-style-type: none;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;

}

/* main {
    margin-top: 60px;
} */

.header {
   position: -webkit-sticky;
   position: sticky;
   top: 0;
   left: 0;
   width: 100%;
   height: 70px;
   padding: 2rem;
   background: var(--header-background);
   display: flex;
   justify-content: space-between;
   align-items: center;
   z-index: 100;
}

.header img {
    width: 19rem;
    height: auto;
 }

.header .sticky {
   border-bottom: 1rem solid rgba(0, 0, 0, .2);
}

.navbar a {
   font-size: 16px;
   color: #fff;
   margin-left: 15px;
   transition: .3s;
   text-decoration: none;
}

.navbar a:hover,
.navbar a:active {
   color: #0ef;
}

#menu-icon {
   display: none;
   font-size: 24px;
   cursor: pointer;
}

#toggle-btn {
    padding: 10px 20px;
    margin: 20px;
    font-size: 16px;
    cursor: pointer;
}

.page-header {
    padding: 1.3rem 1rem;
    text-align: center;
    font-size: 30px;
}
.page-header h1{
    background: linear-gradient(135deg, rgb(26, 102, 255), rgb(204, 102, 255));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.page-header h1, .page-header small {
    color: var(--header-background);
}


.page-content {
    padding: 1.3rem 1rem;
    background: #f1f4f9;
}

.summary-cards {
    display: flex;
    margin-bottom: 3.5rem;
    align-items: center;
    justify-content: center;
    gap: 50px;
}
.summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(27,55,100,0.13);
    padding: 20px;
    min-width: 300px;
    min-height: 120px;
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
}
.summary-card:hover {
    box-shadow: 0 4px 20px rgba(27,55,100,0.18);
    transform: translateY(-2px) scale(1.03);
}
.summary-icon {
    font-size: 3.6rem;
    color: #22baa0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.summary-card.votes .summary-icon {
    color: #f6d433;
}
.summary-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.summary-title {
    font-size: 1.22rem;
    color: #888;
    font-weight: 500;
    margin-bottom: 0.2rem;
}
.summary-value {
    font-size: 2.9rem;
    font-weight: 700;
    color: #1B3764;
}
@media (max-width: 900px) {
    .summary-cards {
        flex-direction: row;
        gap: 1.2rem;
        align-items: stretch;
        margin-bottom: 2rem;
    }
    .summary-card {
        min-width: unset;
        width: 100%;
        gap: 0;
        padding: .8rem;
    }
    .summary-icon{
        font-size: 2.6rem;
    }
    .summary-title{
        font-size: 1rem;
    }
    .summary-value{
        font-size: 1.7rem;
    }
    .analytics {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    .card.chart-card {
        min-width: 180px;
        min-height: 180px;
        padding: 1.2rem 1rem 1.5rem 1rem;
    }
    .chart-container {
        height: 130px;
    }
}


.analytics {
    display: grid;
    grid-template-columns: repeat(2, minmax(350px, 1fr));
    grid-gap: 3rem;
    padding: 0 80px;
    margin-top: 0.5rem;
    margin-bottom: 2.5rem;
    align-items: stretch;
}

.card.chart-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0px 8px 32px -6px rgb(27 55 100 / 15%);
    padding: 2.2rem 2rem 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 340px;
    min-height: 340px;
    width: 100%;
}

.chart-card.trend-card {
    margin-left: 20px;
    box-shadow: none;
}
    

.chart-card-scroller {
    box-shadow: 0px 8px 32px -6px rgb(27 55 100 / 15%);
    background: #fff;
    border-radius: 18px;
    max-width: 95dvw;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.chart-container {
    width: 100%;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1200px) {
  .analytics {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .card.chart-card {
    min-width: 240px;
    min-height: 240px;
    padding: 1.2rem 1rem 1.5rem 1rem;
  }
  .chart-container {
    height: 180px;
  }
}
@media (max-width: 900px) {
  .analytics {
    grid-template-columns: 1fr;
  }
  .chart-card {
    min-width: 180px;
    min-height: 180px;
  }
}


.card {
    box-shadow: 0px 5px 5px -5px rgb(0 0 0 / 10%);
    background: #fff;
    padding: 1rem;
    border-radius: 18px;
}
.card.votes{
    border: solid 2px #f6d433;
}
.card.nominees{
    border: solid 2px #22baa0;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-head h2 {
    color: #333;
    font-size: 1rem;
    font-weight: 500;
}

.card-head span {
    font-size: 1rem;
    color: var(--text-grey);
}

.card-progress small {
    color: #777;
    font-size: 1rem;
    font-weight: 600;
}

.card-indicator {
    margin: .7rem 0rem;
    height: 10px;
    border-radius: 4px;
    background: #e9edf2;
    overflow: hidden;
}

.indicator {
    height: 10px;
    border-radius: 4px;
}

.indicator.one {
    background: #22baa0;
}

.indicator.two {
    background: #11a8c3;
}

.indicator.three {
    background: #f6d433;
}

.indicator.four {
    background: #f25656;
}

.records {
    box-shadow: 0px 5px 5px -5px rgb(0 0 0 / 10%);
    background: #fff;
    border-radius: 3px;
}

.record-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.add, .browse {
    display: flex;
    align-items: center;
}

.add span {
    display: inline-block;
    margin-right: .6rem;
    font-size: 1rem;
    color: #666;
}

input, button, select {
    outline: none;
}

.add select, .browse input, .browse select {
    height: 35px;
    border: 1px solid #b0b0b0;
    border-radius: 3px;
    display: inline-block;
    width: 75px;
    padding: 0rem .5rem;
    margin-right: .8rem;
    color: #666;
}

.add button {
    background: var(--main-color);
    color: #fff;
    height: 37px;
    border-radius: 4px;
    padding: 0rem 1rem;
    border: none;
    font-weight: 600;
}

.browse input {
    width: 150px;
}

.browse select {
    width: 100px;
}

.table-responsive {
    width: 100%;
    overflow: auto;
}

/* Desktop table: show on screens >600px */
.results-table-desktop {
    border: none;
    border-collapse: collapse;
    padding: 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(27,55,100,0.08);
    overflow: hidden;
    margin-top: 18px;
    font-size: 1.08rem;
    transition: box-shadow 0.2s;
    width: 100%;
}
.results-table-desktop thead{
    background-color: #1B3764;
}
.results-table-mobile {
    display: none;
}

@media (max-width: 600px) {
    .results-table-desktop {
        display: none;
    }
    .results-table-mobile {
        display: table;
        width: 100%;
        border: none;
        background: none;
    }
    .results-table-mobile tbody {
        display: block;
        width: 100%;
    }
    .results-table-mobile .candidate-row {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: stretch;
        background: #fff;
        box-shadow: 0 2px 12px rgba(27,55,100,0.10);
        border-radius: 14px;
        margin-bottom: 18px;
        padding: 0.7rem 0.7rem 0.7rem 0.7rem;
        transition: box-shadow 0.18s, background 0.18s;
        position: relative;
        border: none;
        gap: 12px;
    }
    .results-table-mobile .candidate-row:active {
        box-shadow: 0 4px 18px rgba(27,55,100,0.16);
        background: #f7faff;
    }
    .candidate-mobile-main {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        flex: 2;
        min-width: 0;
    }
    .candidate-img {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background-size: cover;
        background-position: center;
        background-color: #e9edf2;
        flex-shrink: 0;
        margin-right: 8px;
        border: 2px solid #e9edf2;
        box-shadow: 0 1px 4px rgba(27,55,100,0.10);
        display: block;
    }
    .candidate-mobile-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 2px;
        min-width: 0;
        text-align: left;
    }
    .candidate-code {
        font-size: 1.04rem;
        font-weight: 600;
        color: #1B3764;
        opacity: 0.92;
        letter-spacing: 0.01em;
        margin-bottom: 2px;
        word-break: break-all;
    }
    .candidate-name {
        font-size: 1.07rem;
        font-weight: 500;
        color: #222;
        word-break: break-word;
    }
    .candidate-mobile-stats {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        flex: 1;
        min-width: 0;
        text-align: right;
        gap: 6px;
    }
    .candidate-votes {
        font-size: 1.05rem;
        font-weight: 600;
        color: #22baa0;
        margin-bottom: 4px;
    }
    .progress-bar-outer {
        width: 90px;
        height: 12px;
        margin: 0 0 0 0;
        align-self: flex-end;
    }
    .results-table-mobile td {
        border: none;
        background: none;
        padding: 0;
    }
}

.candidate-info-cell {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    text-align: left;
}
.candidate-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #e9edf2;
    flex-shrink: 0;
    margin-right: 8px;
    border: 2px solid #e9edf2;
    box-shadow: 0 1px 4px rgba(27,55,100,0.10);
    display: block;
}
.candidate-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.results-table thead tr {
    background: #1B3764
}

.results-table thead th {
    padding: 1rem 0.5rem;
    text-align: left;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.results-table tbody tr.candidate-row {
    transition: background 0.16s, box-shadow 0.16s;
}
.results-table tbody tr.candidate-row:hover {
    background: #f1f4f9;
    box-shadow: 0 2px 8px rgba(27,55,100,0.08);
}

.results-table tbody td {
    padding: 1rem 0.5rem;
    color: #222;
    font-size: 1rem;
    vertical-align: middle;
}

.progress-bar-outer {
    width: 120px;
    height: 14px;
    background: #e9edf2;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: 0 1px 2px rgba(27,55,100,0.06);
    position: relative;
}
.candidate-progress-bar {
    height: 100%;
    width: 0;
    border-radius: 8px;
    background: #22baa0;
    transition: width 1.2s cubic-bezier(.4,2,.6,1), background 0.5s;
}

@media (max-width: 600px) {
    .results-table {
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        width: 100%;
        display: block;
        overflow-x: auto;
        padding: 0;
    }
    .results-table thead,
    .results-table thead tr {
        display: none;
    }
    .results-table tbody {
        display: block;
        width: 100%;
    }
    .results-table tbody tr.candidate-row {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: stretch;
        background: #fff;
        box-shadow: 0 2px 12px rgba(27,55,100,0.10);
        border-radius: 14px;
        margin-bottom: 18px;
        padding: 0.7rem 0.7rem 0.7rem 0.7rem;
        transition: box-shadow 0.18s, background 0.18s;
        position: relative;
        border: none;
        gap: 12px;
    }
    .results-table tbody tr.candidate-row:active {
        box-shadow: 0 4px 18px rgba(27,55,100,0.16);
        background: #f7faff;
    }
    .candidate-info-cell, .candidate-votes-cell {
        display: flex;
        flex-direction: column;
        justify-content: center;
        flex: 1 1 0;
        gap: 6px;
        padding: 0;
        background: none;
    }
    .candidate-info-cell {
        flex-direction: row;
        align-items: center;
        text-align: left;
        justify-content: start;
        min-width: 0;
        gap: 12px;
    }
    .candidate-img {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background-size: cover;
        background-position: center;
        background-color: #e9edf2;
        flex-shrink: 0;
        margin-right: 8px;
        border: 2px solid #e9edf2;
        box-shadow: 0 1px 4px rgba(27,55,100,0.10);
    }
    .candidate-meta {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 2px;
        min-width: 0;
    }
    .candidate-votes-cell {
        align-items: flex-end;
        text-align: right;
        min-width: 0;
        flex: 1;
    }
    .candidate-code {
        font-size: 1.04rem;
        font-weight: 600;
        color: #1B3764;
        opacity: 0.92;
        letter-spacing: 0.01em;
        margin-bottom: 2px;
        word-break: break-all;
    }
    .candidate-name {
        font-size: 1.07rem;
        font-weight: 500;
        color: #222;
        word-break: break-word;
    }
    .candidate-votes {
        font-size: 1.05rem;
        font-weight: 600;
        color: #22baa0;
        margin-bottom: 4px;
    }
    .progress-bar-outer {
        width: 90px;
        height: 12px;
        margin: 0 0 0 0;
        align-self: flex-end;
    }
    .results-table tbody td {
        display: block;
        padding: 0;
        border: none;
        background: none;
        min-height: unset;
        font-size: 1rem;
        color: #222;
        text-align: inherit;
        box-sizing: border-box;
    }
    .results-table tbody td:not(:last-child) {
        border-bottom: none;
    }
    .results-table tbody td:before {
        display: none;
    }
}


@media (max-width: 900px) and (min-width: 601px) {
    .results-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Add data-labels for accessibility (JS or EJS update may be needed if not present) */



table thead tr {
    background: #e9edf2;
}

table thead th {
    padding: 1rem 0rem;
    text-align: left;
    color: #444;
    font-size: 1rem;
}

table thead th:first-child {
    padding-left: 1rem;
}

table tbody td {
    padding: 1rem 0rem;
    color: #444;
    font-size: 1rem;
}

table tbody td:first-child {
    color: var(--second-bg-color);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0;
    flex: 2;
}

table tbody tr {
    padding: 10px;
    border-bottom: 1px solid #dee2e8;
}

.client {
    display: flex;
    align-items: center;
}

.client-img {
    margin-right: .5rem;
    border: 2px solid #b0b0b0;
    height: 45px;
    width: 45px;
}

.client-info h4 {
    color: #555;
    font-size: 1rem;
}

.client-info small {
    color: #777;
}

.actions span {
    display: inline-block;
    font-size: 1rem;
    margin-right: .4rem;
}



@media only screen and (max-width: 1200px) {
    .analytics {
        grid-template-columns: repeat(2, 1fr);
        padding: 0px;
    }
}

@media only screen and (max-width: 768px) {
    .analytics {
        grid-template-columns: 100%;
    }
    
    .sidebar {
        left: -165px;
        z-index: 90;
    }
    
    header {
        left: 0;
        width: 100%;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    #menu-toggle:checked ~ .sidebar {
        left: 0;
    }
    
    #menu-toggle:checked ~ .sidebar {
        width: 165px;
    }

    #menu-toggle:checked ~ .sidebar .side-header span {
        display: inline-block;
    }

    #menu-toggle:checked ~ .sidebar .profile,
    #menu-toggle:checked ~ .sidebar .side-menu a small {
        display: block;
    }

    #menu-toggle:checked ~ .sidebar .side-menu a span {
        font-size: 1rem;
    }
    
    #menu-toggle:checked ~ .main-content header {
        left: 0px;
    }
    
    table {
        width: 900px;
    }
}
@media only screen and (max-width:414px){
    .text{
       visibility:collapse;
    }
    .phonetext{
       visibility:visible;
    }
 }


 /* Custom legend styles for vote distribution chart */
.custom-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 18px;
  max-height: 84px;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 10px 0 0 0;
  padding: 6px 8px 4px 8px;
  background: #f8fafd;
  border-radius: 10px;
  border: 1px solid #e9edf2;
  box-shadow: 0 1px 6px rgba(27,55,100,0.06);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 1rem;
  color: #1B3764;
  font-weight: 500;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.legend-color {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-block;
  margin-right: 4px;
  border: 1.5px solid #e9edf2;
}
.legend-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 600px) {
  .custom-legend {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    max-height: 64px;
    font-size: 0.92rem;
  }
  .legend-item {
    font-size: 0.92rem;
  }
  .legend-color {
    width: 14px;
    height: 14px;
  }
}

/* table css */

.table-container {
    width: 100%;
    overflow-x: auto;
    padding: 10px 0;

}

table {
    width: 100%;
    border-collapse: collapse;
}

.client {
    display: flex;
    align-items: center;
}

.client-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
}

@media (max-width: 600px) {

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }

    td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    td:before {
        position: absolute;
        top: 50%;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        transform: translateY(-50%);
        text-align: left;
    }

    /* td:nth-of-type(2):before {
        content: "NOMINEE";
    } */

    td:nth-of-type(3):before {
        content: "TOTAL VOTES";
    }
    .page-header h1{
        font-size: 20px;
    }
}

/* Responsive fix: ensure chart-container and canvas never overflow on mobile */
@media (max-width: 600px) {
  .chart-container {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0;
    height: 170px !important;
    max-height: 200px;
    overflow: hidden !important;
    margin-left: -16px;
    margin-right: -16px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .chart-container canvas {
    width: 100% !important;
    max-width: 100vw !important;
    height: 150px !important;
    max-height: 170px;
    display: block;
    box-sizing: border-box;
  }
}

