/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

/* Header */
.header {
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 40px;
}

.header-menu-icon {
    position: absolute;
    left: 0;
    font-size: 20px;
    color: white;
    cursor: pointer;
}

.header-menu-btn {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: transparent !important;
    border: none !important;
    color: white !important;
    font-size: 20px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    transition: opacity 0.3s ease;
    z-index: 1001 !important;
    min-width: 44px !important;
    min-height: 44px !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: 100% !important;
}

.header-menu-btn i,
.header-menu-btn i.fas,
.header-menu-btn i.fa-bars {
    display: inline-block !important;
    font-size: 22px !important;
    color: white !important;
    visibility: visible !important;
    opacity: 1 !important;
    line-height: 1 !important;
    font-style: normal !important;
    font-weight: 900 !important;
    font-family: "Font Awesome 6 Free" !important;
    width: auto !important;
    height: auto !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.header-menu-btn i.fa-bars:before {
    content: '\f0c9' !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

/* Fallback icon if FontAwesome doesn't load - hidden when icon exists */
.header-menu-btn:not(:has(i)):before {
    content: '☰';
    display: inline-block;
    font-size: 22px;
    color: white;
    line-height: 1;
}

/* Alternative fallback using empty i tag check */
@supports not selector(:has(*)) {
    .header-menu-btn i:empty:before {
        content: '☰';
        display: inline-block;
        font-size: 22px;
        color: white;
        line-height: 1;
    }
}

.header-menu-btn:hover {
    opacity: 0.8 !important;
}

.header-menu-btn:active {
    opacity: 0.6 !important;
}

.header-menu-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.header-back-btn {
    position: absolute;
    left: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-decoration: none;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
}

.logo span {
    text-align: center;
}

/* Main Content */
.main-content {
    padding: 0;
    padding-bottom: 20px;
    background: #f5f5f5;
    min-height: calc(100vh - 00px);
}

/* Main Content for Search Page - No padding */
.main-content.search-page {
    padding: 0;
    padding-bottom: 100px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    padding: 15px 20px;
    border-radius: 0px;
    color: white;
}

.page-header h1 {
    font-size: 20px;
    flex: 1;
    text-align: center;
}

.back-btn {
    color: white;
    text-decoration: none;
    font-size: 20px;
    padding: 5px 10px;
}

.total-count {
    font-size: 16px;
    font-weight: bold;
}

/* Search Page Header - Matching Image Design */
.search-page-header {
    display: flex;
    align-items: center;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    padding: 15px 20px;
    color: white;
    margin-bottom: 0;
}

.search-page-header .back-btn {
    color: white;
    text-decoration: none;
    font-size: 20px;
    margin-right: 15px;
}

.total-count-text {
    font-size: 18px;
    font-weight: bold;
    flex: 1;
    text-align: center;
}

/* Search Bar Container - Matching Image Design */
.search-bar-container {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.search-box-wrapper {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 25px;
    padding: 12px 5px;
    gap: 10px;
}

.search-icon {
    color: #999;
    font-size: 18px;
}

.voter-search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    color: #333;
	margin-left: 40px;
}

.voter-search-input::placeholder {
    color: #999;
}

.microphone-icon {
    color: #999;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 50%;
}

.microphone-icon:hover {
    color: #833AB4;
    background: rgba(131, 58, 180, 0.1);
    transform: scale(1.1);
}

.microphone-icon.listening {
    color: #833AB4 !important;
    animation: pulse-microphone 1.5s ease-in-out infinite;
    background: rgba(131, 58, 180, 0.2);
}

@keyframes pulse-microphone {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding: 20px;
}

.menu-item {
    background: white;
    border: 3px solid;
    border-image: linear-gradient(50deg, rgba(131, 58, 180, 1), rgba(253, 29, 29, 1), rgba(252, 176, 69, 1)) 1;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 140px;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(131, 58, 180, 0.3);
}

.menu-item.language-item {
    border-style: dashed;
    border-color: #ffb080;
}

.menu-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    box-shadow: 0 4px 12px rgba(131, 58, 180, 0.3);
}

.menu-label {
    font-size: 16px;
    font-weight: 600;
    color: #833AB4;
    line-height: 1.4;
}

/* Search Container */
.search-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-box {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 25px;
    padding: 12px 20px;
    margin-bottom: 15px;
}

.search-box i {
    color: #999;
    margin: 0 10px;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
}

.filter-section {
    margin-top: 15px;
}

.filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.filter-select,
.filter-input {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.search-btn {
    width: 100%;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.search-btn:hover {
    opacity: 0.9;
}

/* Voter List */
.voter-list {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.voter-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.voter-item:hover {
    background: #f9f9f9;
}

.voter-item:last-child {
    border-bottom: none;
}

.voter-photo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 15px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voter-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    color: #999;
    font-size: 24px;
}

.voter-info {
    flex: 1;
}

.voter-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.voter-details {
    font-size: 14px;
    color: #666;
}

.voter-options {
    color: #999;
    font-size: 18px;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Voter List Container - Matching Image Design */
.voter-list-container {
    background: white;
    min-height: 400px;
    max-height: calc(100vh - 00px);
    overflow-y: auto;
}

.voter-list-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.voter-list-item:hover {
    background: #f9f9f9;
}

.voter-list-item:last-child {
    border-bottom: none;
}

.voter-photo-small {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 15px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.voter-photo-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder-small {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 20px;
    background: #f0f0f0;
}

.voter-info-main {
    flex: 1;
    min-width: 0;
}

.voter-name-main {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    line-height: 1.4;
}

.voter-details-main {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.voter-options-icon {
    color: #999;
    font-size: 18px;
    margin-left: 10px;
    flex-shrink: 0;
}

.no-results-message {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-results-message p {
    font-size: 16px;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 20px;
    color: #833AB4;
    font-size: 16px;
}

.loading-indicator i {
    margin-right: 10px;
    font-size: 20px;
}

/* Advance Search Page */
.advance-search-page {
    padding: 0;
    padding-bottom: 100px;
}

.advance-search-header {
    display: flex;
    align-items: center;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    padding: 15px 20px;
    color: white;
}

.advance-search-header .back-btn {
    color: white;
    text-decoration: none;
    font-size: 20px;
    margin-right: 15px;
}

.advance-search-header h1 {
    font-size: 20px;
    font-weight: bold;
    flex: 1;
    text-align: center;
    margin: 0;
}

.advance-search-form {
    padding: 20px;
    background: #f5f5f5;
    min-height: calc(100vh - 00px);
}

.search-field-card {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}

.search-field-card:focus-within {
    box-shadow: 0 4px 12px rgba(131, 58, 180, 0.2);
}

.field-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    border-radius: 10px;
    color: white;
    font-size: 18px;
    margin-right: 15px;
    flex-shrink: 0;
}

.search-field-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #333;
    background: transparent;
}

.search-field-input::placeholder {
    color: #999;
}

.advance-search-btn {
    width: 100%;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(131, 58, 180, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.advance-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(131, 58, 180, 0.4);
}

.advance-search-btn:active {
    transform: translateY(0);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.page-link {
    color: #833AB4;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-link:hover {
    background: #f0edff;
}

.page-info {
    font-size: 14px;
    color: #666;
}

/* Filter Menu Grid */
.filter-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

/* List Page Styles */
.list-page {
    padding: 0;
    padding-bottom: 100px;
}

.list-page-header {
    display: flex;
    align-items: center;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    padding: 15px 20px;
    color: white;
}

.list-page-header .back-btn {
    color: white;
    text-decoration: none;
    font-size: 20px;
    margin-right: 15px;
}

.list-page-header h1 {
    font-size: 20px;
    font-weight: bold;
    flex: 1;
    text-align: center;
    margin: 0;
}

.filter-menu-grid-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
    background: white;
}

.filter-menu-item-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s;
}

.filter-menu-item-list:hover {
    transform: scale(1.05);
}

.filter-icon-list {
    width: 70px;
    height: 70px;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(131, 58, 180, 0.3);
}

.filter-icon-list i {
    font-size: 28px;
}

.filter-label-list {
    font-size: 12px;
    text-align: center;
    color: #833AB4;
    font-weight: 600;
    line-height: 1.3;
    max-width: 90px;
}

.voter-list-container-list {
    background: white;
    margin-top: 0;
    padding-bottom: 20px;
}

.applied-filters-title {
    font-size: 16px;
    font-weight: 600;
}

.list-results-header {
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    padding: 15px 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-count-list {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

.filter-chip-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid #d4c5f0;
    background: #f5f2ff;
}

.filter-chip {
    background: #fff;
    border: 1px solid #c9b5e8;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    color: #833AB4;
}

.filter-chip strong {
    color: #333;
    font-weight: 600;
}

.no-results-message.guidance {
    padding: 40px 20px;
    text-align: center;
    font-size: 16px;
    color: #833AB4;
    background: #f5f2ff;
}


/* Color modal */
.color-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none !important;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.color-modal.open {
    display: block !important;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

body.modal-open {
    overflow: hidden;
}

.color-modal .color-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0);
    z-index: 10001;
    transition: background 0.3s ease;
}

.color-modal.open .color-modal-backdrop {
    background: rgba(0,0,0,0.5);
}

.color-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    max-width: 500px;
    width: calc(100% - 40px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10002;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.color-modal.open .color-modal-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.color-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.color-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #833AB4;
}

.color-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.color-option {
    border: none;
    border-radius: 10px;
    padding: 12px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    background: #e0e0e0;
}

.color-option:hover {
    opacity: 0.8;
}

.color-option.active.color-apale {
    background: #2e7d32;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.3);
    transform: translateY(-2px);
}

.color-option.active.color-virodhi {
    background: #c62828;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.3);
    transform: translateY(-2px);
}

.color-option.active.color-sandigdha {
    background: #c49000;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(196, 144, 0, 0.3);
    transform: translateY(-2px);
}

.color-option.active.color-itar {
    background: #616161;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(97, 97, 97, 0.3);
    transform: translateY(-2px);
}

.color-status {
    min-height: 20px;
    font-size: 14px;
    color: #4caf50;
}

.color-status.error {
    color: #c62828;
}

.color-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Vote modal */
.vote-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none !important;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.vote-modal.open {
    display: block !important;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.vote-modal .vote-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0);
    z-index: 10001;
    transition: background 0.3s ease;
}

.vote-modal.open .vote-modal-backdrop {
    background: rgba(0,0,0,0.5);
}

.vote-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    max-width: 500px;
    width: calc(100% - 40px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10002;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.vote-modal.open .vote-modal-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.vote-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.vote-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #833AB4;
}

.vote-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.vote-option {
    border: none;
    border-radius: 10px;
    padding: 12px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    background: #e0e0e0;
}

.vote-option:hover {
    opacity: 0.8;
}

.vote-option.active.vote-yes {
    background: #2e7d32;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.3);
    transform: translateY(-2px);
}

.vote-option.active.vote-no {
    background: #c62828;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.3);
    transform: translateY(-2px);
}

.vote-status {
    min-height: 20px;
    font-size: 14px;
    color: #4caf50;
}

.vote-status.error {
    color: #c62828;
}

.vote-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Visited modal */
.visited-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none !important;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.visited-modal.open {
    display: block !important;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.visited-modal .visited-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0);
    z-index: 10001;
    transition: background 0.3s ease;
}

.visited-modal.open .visited-modal-backdrop {
    background: rgba(0,0,0,0.5);
}

.visited-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    max-width: 500px;
    width: calc(100% - 40px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10002;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.visited-modal.open .visited-modal-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.visited-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.visited-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #833AB4;
}

.visited-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.visited-option {
    border: none;
    border-radius: 10px;
    padding: 12px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    background: #e0e0e0;
}

.visited-option:hover {
    opacity: 0.8;
}

.visited-option.active.visited-yes {
    background: #2e7d32;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.3);
    transform: translateY(-2px);
}

.visited-option.active.visited-no {
    background: #c62828;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.3);
    transform: translateY(-2px);
}

.visited-status {
    min-height: 20px;
    font-size: 14px;
    color: #4caf50;
}

.visited-status.error {
    color: #c62828;
}

.visited-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Filter List Page Styles */
.filter-list-page {
    padding: 0;
    padding-bottom: 100px;
}

.filter-list-header {
    display: flex;
    align-items: center;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    padding: 15px 20px;
    color: white;
}

.filter-list-header .back-btn {
    color: white;
    text-decoration: none;
    font-size: 20px;
    margin-right: 15px;
}

.filter-list-header h1 {
    font-size: 20px;
    font-weight: bold;
    flex: 1;
    text-align: center;
    margin: 0;
}

.filter-search-bar {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.search-box-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #833AB4;
    font-size: 18px;
}

.filter-search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ffd0b7;
    border-radius: 12px;
    font-size: 16px;
    background: #fff7f2;
    color: #333;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-search-input:focus {
    border-color: #833AB4;
    box-shadow: 0 0 0 3px rgba(131, 58, 180, 0.15);
}

.filter-list-container {
    background: white;
    min-height: 400px;
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    padding: 20px;
    background: white;
}

.alphabet-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 10px;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    background: #fff7f2;
    border: 1px solid #ffe0d0;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.alphabet-card:hover {
    transform: translateY(-2px);
    border-color: #833AB4;
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

.alphabet-letter {
    font-size: 28px;
    font-weight: 700;
    color: #833AB4;
    margin-bottom: 8px;
}

.alphabet-count {
    font-size: 13px;
    color: #666;
}

.filter-list-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.filter-list-item:hover {
    background: #f9f9f9;
}

.filter-list-item:last-child {
    border-bottom: none;
}

.filter-list-letter {
    font-size: 1.2em;
    font-weight: bold;
    color: #833AB4;
    width: 70%;
    text-align: left;
    margin-right: 10px;
    flex-shrink: 0;
}

.filter-list-info {
    flex: 1;
}

.filter-list-total {
    font-size: 16px;
    color: #666;
}

.filter-list-options {
    color: #999;
    font-size: 18px;
    margin-left: 10px;
    flex-shrink: 0;
}

.filter-menu-item {
    background: white;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.filter-menu-item:hover {
    transform: scale(1.1);
}

.filter-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.filter-label {
    font-size: 11px;
    margin-top: 5px;
    text-align: center;
    color: #833AB4;
    font-weight: 600;
}

/* Voter Detail */
.voter-detail-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.voter-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
}

.survey-btn {
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
}

.voter-detail-photo {
    text-align: center;
    margin-bottom: 20px;
}

.voter-detail-photo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #833AB4;
}

.photo-placeholder-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 48px;
    color: #999;
    border: 4px solid #833AB4;
}

.voter-detail-name {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.voter-detail-id {
    text-align: center;
    color: #666;
    margin-bottom: 10px;
}

.voter-detail-location {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.voter-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item {
    text-align: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
}

.detail-value {
    font-size: 24px;
    font-weight: bold;
    color: #833AB4;
    margin-bottom: 5px;
}

.detail-label {
    font-size: 12px;
    color: #666;
}

.voter-detail-info {
    margin-top: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #666;
}

.info-value {
    color: #333;
    text-align: right;
    flex: 1;
    margin-left: 10px;
}

.action-icon {
    color: #833AB4;
    margin-left: 10px;
    text-decoration: none;
    font-size: 18px;
}

.voter-detail-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(48px, 1fr));
    gap: 14px;
    background: #fff;
    padding: 18px 14px;
    border-radius: 28px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    margin-top: 20px;
	justify-content: space-evenly;
    align-items: center;
    align-content: stretch;
    justify-items: center;
}

.action-btn {
    border: none;
    background: transparent;
}

.action-btn.icon-btn {
    width: 56px;
    height: 56px;
    border-radius: 20px;
    background: #f6f6f7;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #833AB4;
    font-size: 22px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn.icon-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.action-btn.icon-btn.action-whatsapp {
    background: rgba(37,211,102,0.15);
    color: #1f9d4b;
}

.action-btn.icon-btn.action-print {
    background: rgba(255,182,77,0.2);
    color: #d97706;
}

.action-btn.icon-btn.action-print-slip {
    background: rgba(34,139,34,0.2);
    color: #228b22;
}

.action-btn.icon-btn.action-home {
    background: rgba(102,126,234,0.15);
}

.action-btn.icon-btn.action-call {
    background: rgba(102,126,234,0.2);
}

.action-btn.icon-btn.action-booth {
    background: rgba(118,75,162,0.15);
}

.action-btn.icon-btn.action-family {
    background: rgba(96,125,139,0.15);
    color: #37474f;
}

.action-btn.icon-btn.action-important {
    background: rgba(255,214,0,0.25);
    color: #c49100;
}

.color-btn {
    grid-column: span 2;
    border-radius: 36px;
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: #fff;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(76,175,80,0.3);
}

.color-btn i {
    font-size: 18px;
}

@media (max-width: 480px) {
    .voter-detail-actions {
        grid-template-columns: repeat(4, minmax(48px, 1fr));
    }

    .color-btn {
        grid-column: span 4;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.dashboard-section {
    margin-top: 30px;
    background: transparent;
}

.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 15px;
}

.dashboard-section-header h2 {
    margin-bottom: 5px;
    font-size: 22px;
    color: #833AB4;
}

.dashboard-section-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.dashboard-link {
    color: #833AB4;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.chart-card {
    background: white;
    border-radius: 15px;
    padding: 18px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 10px;
}

.chart-card-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.chart-card-header p {
    margin: 5px 0 0;
    color: #777;
    font-size: 13px;
}

.chart-total {
    font-size: 14px;
    font-weight: 600;
    color: #833AB4;
    white-space: nowrap;
}

.chart-canvas-wrapper {
    flex: 1;
    position: relative;
}

.chart-canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.charts-page .chart-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

@media (max-width: 600px) {
    .chart-card {
        padding: 14px;
        min-height: 260px;
    }

    .chart-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-total {
        margin-top: 6px;
    }

    .chart-canvas-wrapper {
        min-height: 220px;
    }
}

.stat-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s;
}

.stat-item {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-link:hover .stat-item,
.stat-link:focus .stat-item {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

.stat-circle {
    width: 100px;
    height: 100px;
    border: 4px solid #833AB4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 24px;
    font-weight: bold;
    color: #833AB4;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

/* Upload */
.upload-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.upload-card {
    text-align: center;
}

.upload-card h2 {
    color: #833AB4;
    margin-bottom: 20px;
}

.upload-info {
    text-align: left;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.8;
}

.file-input-wrapper {
    margin-bottom: 20px;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.file-label:hover {
    opacity: 0.9;
}

.upload-btn {
    width: 100%;
    background: linear-gradient(50deg, rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.upload-btn:hover {
    opacity: 0.9;
}

.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    padding: 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    text-align: center;
    z-index: 100;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 20px;
}

.social-link.whatsapp {
    background: #25D366;
}

.social-link.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-link.facebook {
    background: #1877F2;
}

.contact-info {
    margin-top: 15px;
    position: relative;
}

.phone-number {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    z-index: 2;
    position: relative;
}

/* Crowd background effect */
.contact-info::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 60px;
    background: linear-gradient(to top, rgba(131, 58, 180, 0.1), transparent);
    border-radius: 50% 50% 0 0;
    z-index: 1;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }
    
    .menu-grid {
        gap: 15px;
    }
    
    .filter-menu-grid {
        gap: 10px;
    }
    
    .filter-menu-item {
        width: 70px;
        height: 70px;
    }
    
    .filter-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .filter-label {
        font-size: 10px;
    }
}

