/* 
 * Hemicycle Stats Scrutins Front - Premium Styles
 * Typography: Inter
 * Theme: Glassmorphism / Dashboards
 */

.hemicycle-scrutins-front-container {
    --primary-color: #3b82f6;
    --bg-glass: rgba(128, 128, 128, 0.1);
    --bg-card: rgba(128, 128, 128, 0.05);
    --bg-header: rgba(128, 128, 128, 0.15);
    --border-glass: rgba(128, 128, 128, 0.2);
    --text-main: inherit;
    --text-muted: inherit;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text-main);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Dashboard Header & Group Filters */
.hemicycle-group-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.hemicycle-group-pill {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05); /* Gray background when inactive */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    outline: none;
    white-space: nowrap !important;
    width: auto !important;
    flex-shrink: 0 !important;
}

.hemicycle-group-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.hemicycle-group-pill.active {
    background: var(--primary-color) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Special style for "Tous" button when active */
.hemicycle-group-pill[data-guid="all"].active {
    background: #10b981 !important; /* Green Emerald */
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.hemicycle-group-toggle {
    display: none; /* Deprecated in favor of pill */
}

/* Dynamic Summary Block */
.hemicycle-dynamic-summary-glass {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}
.hemicycle-summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    flex-shrink: 0;
}
.hemicycle-summary-content strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Glassmorphism Filters */
.hemicycle-filters-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
}

.hemicycle-date-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.hemicycle-filter-group {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 200px;
}

.hemicycle-filter-group input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    color: var(--text-main);
    background: var(--bg-card);
}

.hemicycle-filter-group .filter-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
}

.hemicycle-btn-primary {
    padding: 12px 24px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.hemicycle-btn-primary:hover {
    background: #2563eb;
}

/* Charts Grid */
.hemicycle-charts-row {
    margin-bottom: 30px;
}
.hemicycle-chart-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-glass);
    position: relative;
    height: 300px;
}

.hemicycle-chart-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    color: var(--text-main);
}

/* Scrutins Grid */
.hemicycle-scrutins-list h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.hemicycle-scrutins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.hemicycle-scrutin-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-glass);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.hemicycle-scrutin-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.hemicycle-scrutin-card.disabled {
    opacity: 0.5;
    filter: grayscale(100%);
}

.hemicycle-scrutin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.hemicycle-scrutin-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.hemicycle-scrutin-status.adopte { background: rgba(22, 163, 74, 0.15); color: #22c55e; }
.hemicycle-scrutin-status.rejete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Scrutin Type Badge */
.hemicycle-scrutin-type-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border-glass);
    display: inline-block;
    white-space: nowrap;
}

.hemicycle-scrutin-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

/* Custom Toggle Checkbox */
.hemicycle-scrutin-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}
.hemicycle-scrutin-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.hemicycle-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}
.hemicycle-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 2px; bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .hemicycle-toggle-slider { background-color: var(--primary-color); }
input:checked + .hemicycle-toggle-slider:before { transform: translateX(20px); }

/* Title *//* Accordion Layout */
.hemicycle-accordion-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hemicycle-accordion-group {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.hemicycle-accordion-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-header);
    cursor: pointer;
    transition: background 0.2s;
    gap: 12px;
}
.hemicycle-accordion-header:hover {
    background: var(--bg-glass);
}

.hemicycle-accordion-title {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}
.hemicycle-accordion-count {
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0.8;
    font-weight: 500;
}
.hemicycle-accordion-icon {
    color: var(--text-muted);
    transition: transform 0.3s;
}
.hemicycle-accordion-group.open .hemicycle-accordion-icon {
    transform: rotate(180deg);
}
.hemicycle-accordion-content {
    border-top: 1px solid var(--border-glass);
    padding: 16px 20px;
    display: none;
    background: transparent;
    flex-direction: column;
    gap: 16px;
}

/* Scrutin Row Item (inside accordion) */
.hemicycle-scrutin-row-item {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    transition: opacity 0.3s;
}
.hemicycle-scrutin-row-item.disabled {
    opacity: 0.5;
}

.hemicycle-row-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.hemicycle-row-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
@media (max-width: 768px) {
    .hemicycle-row-body {
        flex-direction: column;
        align-items: stretch;
    }
}

.hemicycle-row-title-col {
    flex: 1;
}
.hemicycle-row-votes-col {
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-card);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
}

.hemicycle-btn-details-row {
    margin-top: 4px;
    padding: 6px 0;
    font-size: 12px;
    background: var(--bg-header);
    border: none;
    color: inherit;
    border-radius: 4px;
    cursor: pointer;
}

/* Restored inner row elements */
.hemicycle-scrutin-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 12px 0;
}
.hemicycle-scrutin-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}
.hemicycle-scrutin-title a:hover {
    color: var(--primary-color);
}

.hemicycle-scrutin-proposants {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.hemicycle-avatars-group {
    display: flex;
}
.hemicycle-avatars-group .hemicycle-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-left: -8px;
    object-fit: cover;
    box-shadow: var(--shadow-soft);
}
.hemicycle-avatars-group .hemicycle-avatar:first-child {
    margin-left: 0;
}
.hemicycle-badges-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.hemicycle-badge-small {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.hemicycle-scrutin-votes-bar {
    height: 6px;
    border-radius: 3px;
    background: #f3f4f6;
    display: flex;
    overflow: hidden;
    margin-bottom: 4px;
}
.vote-bar.pour { background: #10b981; }
.vote-bar.contre { background: #ef4444; }
.vote-bar.abs { background: #9ca3af; }

.hemicycle-scrutin-votes-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}


/* Control Bar (Pills & Search) */
.hemicycle-control-bar-glass {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
    z-index: 100;
}

.hemicycle-control-search {
    position: relative;
    flex: 1 1 250px;
}
.hemicycle-control-search input {
    width: 100%;
    padding: 10px 10px 10px 40px;
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-main);
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.hemicycle-control-search input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.hemicycle-control-search .filter-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.hemicycle-control-pills {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 4px; /* For scrollbar if it appears */
}

.hemicycle-pill {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    width: auto !important;
    display: inline-block !important;
    white-space: nowrap;
    flex-shrink: 0;
}
.hemicycle-pill:hover {
    background: var(--bg-header);
    color: var(--text-main);
}
.hemicycle-pill.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.hemicycle-pill.action-pill {
    background: var(--bg-card);
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.hemicycle-pill.action-pill:hover {
    background: var(--primary-color);
    color: #fff;
}
.hemicycle-divider {
    width: 1px;
    height: 24px;
    background: #e5e7eb;
    margin: 0 5px;
}

/* Scrutin Details Toggle */
.hemicycle-scrutin-details-toggle {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}
.hemicycle-btn-details {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 0;
    transition: color 0.2s;
}
.hemicycle-btn-details:hover {
    color: #2563eb;
}
.hemicycle-btn-details svg {
    transition: transform 0.3s ease;
}
.hemicycle-btn-details.open svg {
    transform: rotate(180deg);
}

.hemicycle-scrutin-details-container {
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 13px;
}
.hemicycle-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-glass);
}
.hemicycle-detail-row:last-child {
    border-bottom: none;
}
.hemicycle-detail-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-main);
}
.hemicycle-detail-votes {
    display: flex;
    gap: 12px;
}
.hemicycle-detail-votes span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Floating Action Button */
.hemicycle-fab-update {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
    opacity: 0;
    pointer-events: none;
}
.hemicycle-fab-update.visible {
    opacity: 1;
    pointer-events: auto;
}
.hemicycle-fab-update:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 20px -3px rgba(59, 130, 246, 0.5);
}

/* Mobile Media Queries */
@media (max-width: 768px) {
    .hemicycle-charts-row {
        flex-direction: column;
    }
    .hemicycle-chart-card {
        width: 100%;
        min-width: unset;
    }
    .hemicycle-control-bar-glass {
        flex-direction: column;
        align-items: stretch;
        position: static;
        gap: 12px;
    }
    .hemicycle-control-pills {
        justify-content: center;
    }
    .hemicycle-scrutin-row-item {
        flex-direction: column;
        gap: 16px;
    }
    .hemicycle-row-votes-col {
        width: 100%;
    }
    .hemicycle-fab-update {
        bottom: 20px;
        right: 20px;
        left: 20px;
        justify-content: center;
    }
}
