﻿/* Lawyer Election Dashboard Styles */

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: lawyer-pulse 2s infinite;
}

    .status-indicator.live {
        background-color: #28a745;
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    .status-indicator.offline {
        background-color: #6c757d;
        animation: none;
    }

@keyframes lawyer-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(40, 167, 69, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Chart Container Styles */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Hover Effects */
.hover-highlight:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.candidate-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.region-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* Custom Scrollbars */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

    .custom-scrollbar::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

/* Progress Bar Animations */
.progress-bar {
    transition: width 0.6s ease;
}

/* Badge Effects */
.badge {
    transition: all 0.3s ease;
}

    .badge:hover {
        transform: scale(1.05);
    }

/* Timeline Dot Styles */
.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
}

    .timeline-dot::after {
        content: '';
        position: absolute;
        width: 20px;
        height: 20px;
        border: 2px solid currentColor;
        border-radius: 50%;
        top: -4px;
        left: -4px;
        opacity: 0.3;
    }

/* Committee Results */
.candidate-item {
    transition: all 0.3s ease;
}

    .candidate-item:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

.committee-list::-webkit-scrollbar {
    width: 6px;
}

.committee-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.committee-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.region-section {
    border-left: 3px solid #17a2b8;
    padding-left: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .status-indicator {
        width: 6px;
        height: 6px;
    }

    .chart-container {
        height: 250px;
    }
}

@media (max-width: 576px) {
    .candidate-card,
    .region-card {
        margin-bottom: 1rem;
    }

    .timeline-dot {
        width: 10px;
        height: 10px;
    }
}
.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.logo-container {
    position: relative;
}

.logo-image {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

    .logo-image:hover {
        transform: scale(1.05);
    }

.stats-card {
    transition: transform 0.3s ease;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

    .stats-card:hover {
        transform: translateY(-5px);
    }

.stats-icon i {
    font-size: 3rem;
}

.loading-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card {
    backdrop-filter: blur(10px);
}

.btn-group .btn {
    border-radius: 20px;
    margin: 0 2px;
}

@media (max-width: 768px) {
    .logo-image {
        width: 40px;
        height: 40px;
    }

    .display-6 {
        font-size: 1.5rem;
    }

    .stats-icon i {
        font-size: 2rem;
    }
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

    .status-indicator.live {
        background-color: #28a745;
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    .status-indicator.offline {
        background-color: #6c757d;
        animation: none;
    }

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(40, 167, 69, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


.election-container-wrapper {
    font-family: 'Kanit', sans-serif;
    background-color: #3da775;
    padding: 20px;
    border-radius: 16px;
}

.election-title {
    color: white;
    text-align: center;
    margin-bottom: 16px;
    font-weight: 500;
}

.election-progress-bar {
    display: flex;
    width: 100%;
    height: 36px; /* <-- ปรับลดอีกครั้ง */
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.segment {
    height: 100%;
    display: flex;
    align-items: center;
    color: white;
    transition: width 0.5s ease-in-out;
}

    /* --- สไตล์สำหรับ 3 อันดับแรก --- */
    .segment.rank-top-3 {
        padding: 0 10px;
        justify-content: center;
    }

.segment-content-top3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px; /* เพิ่มระยะห่างเล็กน้อย */
}

.candidate-name {
    font-size: 0.8rem; /* <-- ปรับลดขนาดฟอนต์ */
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-circle-large {
    flex-shrink: 0;
    width: 70px;
    height: 25px;
    background-color: white;
    color: #212529;
    border-radius: 25px;
    font-weight: bold;
    font-size: 0.7rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- สไตล์สำหรับอันดับ 4 เป็นต้นไป --- */
.segment.rank-other {
    justify-content: center;
}

.score-circle-small {
    width: 50px;
    height: 25px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.7rem;
    border: 2px solid white;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-set {
    width: 180px;
    border: 2px solid #3234AE;
}

.btn-active {
    background: #3234AE;
}

.btn-outline {
    background: #fff;
    color: #3234AE;
}

    .btn-outline:hover, .btn-active:hover{
        background: #eeeeff;
        color: #3234AE;
        border: 2px solid #3234AE;
    }

/* New CSS for Scrollable List */
.candidate-list-scroll {
    max-height: 350px; /* กำหนดความสูงสูงสุดของรายการ */
    overflow-y: auto; /* แสดงแถบเลื่อนแนวตั้งเมื่อเนื้อหาเกิน */
    overflow-x: hidden; /* ซ่อนแถบเลื่อนแนวนอน */
}

/* Card and General Layout */
.candidate-summary-card {
    border-radius: 15px;
    border: 2px solid #ebebff;
    /*    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);*/
}

    .candidate-summary-card .card-header {
/*        background-color: #fff;*/
        border-bottom: none;

    }

/* Candidate List Item */
.candidate-list-item {
    padding-top: 5px;
    padding-bottom: 5px;
}

/* Rank Badge */
.rank-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 25px;
    height: 25px;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 10px;
    flex-shrink: 0;
}

/* Candidate Photo */
.candidate-photo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    object-position: top center;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
    border-radius: 5px;
}

/* Candidate Details */
.candidate-info {
    flex-grow: 1;
}

    .candidate-info h6 {
        line-height: 1.2;
    }

    .candidate-info small {
        line-height: 1.2;
    }

/* Vote Count */
.vote-count-container {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: right;
    padding-left: 1rem;
}

@media (max-width: 576px) {
    .candidate-list-item {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }

    .candidate-info {
        flex-direction: column;
        align-items: flex-start;
        flex-grow: 1;
    }

    .vote-count-container {
        font-size: 1.2rem;
    }
}


/* Styling for the entire page container */
.polling-page-container {
    margin-top: 2rem;
}

/* Polling station list sidebar card */
.polling-list-card {
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* This is the key part for scrollability */
.polling-list-scroll {
    max-height: 50vh; /* กำหนดความสูงสูงสุดเป็น 80% ของความสูงหน้าจอ */
    overflow-y: auto; /* แสดงแถบเลื่อนแนวตั้งเมื่อเนื้อหาเกิน */
    overflow-x: hidden; /* ซ่อนแถบเลื่อนแนวนอน */
}

/* Styling for list items */
.polling-list-card .list-group-item {
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}

    .polling-list-card .list-group-item:hover {
        background-color: #f8f9fa;
    }

    .polling-list-card .list-group-item.active {
        background-color: #007bff;
        color: white;
        border-color: #007bff;
    }

        .polling-list-card .list-group-item.active .text-muted {
            color: rgba(255, 255, 255, 0.7) !important;
        }

/* Candidate score card styles (from previous code) */


.candidate-list-scroll {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

.candidate-list-item {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.rank-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}



.vote-count-container {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: right;
    padding-left: 1rem;
}

.rank-badge-mini {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    color: white;
    border-radius: 20%;
    font-weight: bold;
    font-size: 12px;
    flex-shrink: 0;
    position: absolute;
    right: -10px;
    bottom: 5px;
}

/* New CSS for Scrollable List */
.candidate-card-list-scroll {
    max-height: 200px; /* กำหนดความสูงสูงสุดของรายการ */
    overflow-y: auto; /* แสดงแถบเลื่อนแนวตั้งเมื่อเนื้อหาเกิน */
    overflow-x: hidden; /* ซ่อนแถบเลื่อนแนวนอน */
}