/* MODERN MINIMAL BLACK & WHITE THEME */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f8f9fa;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1a1a1a;
    line-height: 1.5;
    padding: 24px;
}

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

.app-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Modern Header */
.modern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    color: #000;
}

.header-left p {
    color: #6b7280;
    font-size: 0.875rem;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    padding: 8px 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.user-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: #1f2937;
}

.admin-link {
    color: #000;
    text-decoration: none;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.admin-link:hover {
    background: #f0f0f0;
}

.logout-btn {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.logout-btn:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
}

.stat-icon {
    font-size: 2.5rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 14px;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 6px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: #000;
    line-height: 1;
}

.stat-sub {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 4px;
}

/* Progress Circle */
.progress-circle {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    stroke: #e5e7eb;
    fill: none;
}

.progress-ring-fill {
    stroke: #000;
    fill: none;
    transition: stroke-dashoffset 0.6s ease;
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    font-weight: 700;
}

/* Two Column Layout */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.modern-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    margin-bottom: 0;
}

.card-header {
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #000;
}

.card-header p {
    font-size: 0.8rem;
    color: #6b7280;
}

.modern-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    background: #fff;
}

.modern-input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.search-container, .mark-container, .unmark-container {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-modern, .btn-mark, .btn-unmark {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: 'Inter', sans-serif;
}

.btn-modern {
    background: #000;
    color: #fff;
}

.btn-modern:hover {
    background: #2d2d2d;
    transform: translateY(-1px);
}

.btn-mark {
    background: #10b981;
    color: #fff;
}

.btn-mark:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-unmark {
    background: #ef4444;
    color: #fff;
}

.btn-unmark:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.search-result-modern {
    margin-top: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    border-left: 3px solid #000;
}

.mark-message, .unmark-message {
    margin-top: 12px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    text-align: center;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
    width: 100%;
}

.action-btn:hover {
    border-color: #000;
    transform: translateX(4px);
    background: #fafafa;
}

.btn-count {
    margin-left: auto;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.export-buttons-modern {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.export-btn {
    flex: 1;
    padding: 12px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.export-btn:hover {
    border-color: #000;
    background: #fafafa;
    transform: translateY(-1px);
}

/* Table Section */
.voter-table-section {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin-top: 24px;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.table-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
}

.table-search-input {
    padding: 8px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.8rem;
    width: 250px;
    font-family: 'Inter', sans-serif;
}

.table-search-input:focus {
    outline: none;
    border-color: #000;
}

.table-wrapper-modern {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 14px 16px;
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

td {
    padding: 14px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

tr:hover {
    background: #f9fafb;
}

.serial-cell {
    font-weight: 600;
    color: #000;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-voted-badge {
    background: #10b98120;
    color: #059669;
}

.status-notvoted-badge {
    background: #fef3c7;
    color: #d97706;
}

.action-buttons-group {
    display: flex;
    gap: 8px;
}

.inline-mark-btn, .inline-unmark-btn {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: 'Inter', sans-serif;
}

.inline-mark-btn {
    background: #10b981;
    color: #fff;
}

.inline-mark-btn:hover {
    background: #059669;
    transform: scale(1.02);
}

.inline-unmark-btn {
    background: #ef4444;
    color: #fff;
}

.inline-unmark-btn:hover {
    background: #dc2626;
    transform: scale(1.02);
}

.voted-label {
    color: #9ca3af;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Login Page Styles */
.login-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #fff;
    border-radius: 32px;
    padding: 48px 40px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.08);
    transition: transform 0.2s;
    width: 100%;
}

.login-card:hover {
    transform: translateY(-2px);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: inline-block;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 60px;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #000;
}

.login-header p {
    color: #6c757d;
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    font-size: 1.1rem;
    pointer-events: none;
    color: #adb5bd;
}

.form-control {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1.5px solid #e9ecef;
    border-radius: 16px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    background: #000;
    color: #fff;
    border: none;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-primary:hover {
    background: #2d2d2d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.message-box {
    margin-top: 20px;
    padding: 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    text-align: center;
    animation: slideIn 0.3s;
}

.message-box.error {
    background: #fff5f5;
    color: #c92a2a;
    border: 1px solid #ffe3e3;
}

.message-box.success {
    background: #f0fdf4;
    color: #2b8c4e;
    border: 1px solid #dcfce7;
}

.demo-info {
    margin-top: 32px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 20px;
}

.demo-info h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
    color: #6c757d;
}

.demo-details {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.demo-item {
    flex: 1;
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.demo-label {
    font-size: 0.7rem;
    color: #6c757d;
    display: block;
    margin-bottom: 4px;
}

.demo-value {
    font-size: 0.9rem;
    font-weight: 600;
    font-family: monospace;
    color: #000;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.7rem;
    color: #868e96;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 60px 40px;
    border: 1px solid #e5e7eb;
    margin: 30px 0;
    background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
    border-radius: 12px;
}

.hero-content h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    font-weight: 700;
    color: #000;
}

.hero-content p {
    color: #666;
    margin-bottom: 25px;
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.info-card {
    border: 1px solid #e5e7eb;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    transition: all 0.2s;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.card-number {
    font-size: 2rem;
    font-weight: 800;
    color: #d0d0d0;
    margin-bottom: 15px;
}

.info-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 600;
    color: #000;
}

.info-card p {
    font-size: 0.85rem;
    color: #666;
}

/* Header Styles for index.php */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid #000;
}

.title-section h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #000;
}

.title-section p {
    font-size: 0.8rem;
    color: #666;
    margin-top: 6px;
}

.auth-status {
    background: #f5f5f5;
    padding: 8px 18px;
    border: 1px solid #e0e0e0;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 4px;
}

/* Loading State */
.btn.loading, .btn-primary.loading, .btn-modern.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after, .btn-primary.loading::after, .btn-modern.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-secondary.loading::after {
    border: 2px solid rgba(0,0,0,0.1);
    border-top-color: #000;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Admin Panel Styles */
.admin-actions {
    margin-bottom: 24px;
}

.user-table-section {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.btn-danger-small {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-danger-small:hover {
    background: #dc2626;
    transform: scale(1.02);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 32px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
}

.close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close:hover {
    color: #000;
}

/* Responsive Design */
@media (max-width: 968px) {
    body {
        padding: 16px;
    }
    
    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .search-container, .mark-container, .unmark-container {
        flex-direction: column;
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-search-input {
        width: 100%;
    }
    
    .demo-details {
        flex-direction: column;
    }
    
    .login-card {
        padding: 32px 24px;
        margin: 20px;
    }
    
    .modern-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-content h2 {
        font-size: 1.6rem;
    }
    
    .hero-section {
        padding: 40px 20px;
    }
}

@media (max-width: 640px) {
    .user-info {
        flex-wrap: wrap;
    }
    
    .action-buttons-group {
        flex-direction: column;
    }
    
    th, td {
        padding: 10px 8px;
        font-size: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}