/* Kosovo Municipal Elections Polling System - Modern Responsive Design */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Header Styles */
.header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover {
    color: #3498db;
}

.logo-img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1); /* Makes SVG white */
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Navigation */
.nav {
    display: flex;
    list-style: none;
    gap: 2rem;
}

/* Ensure navigation is always visible on desktop */
@media (min-width: 769px) {
    .nav {
        display: flex !important;
    }
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav a:hover,
.nav a.active {
    background-color: #3498db;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    background-color: #34495e;
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.card-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.card-header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.card-content {
    padding: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 6px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: #27ae60;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

/* Municipality Selection */
.municipality-form {
    background-color: #ecf0f1;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 0;
}

.municipality-form h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.selected-municipality-info {
    background-color: #e8f5e8;
    border: 2px solid #27ae60;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.selected-municipality-info p {
    margin: 0;
    color: #2c3e50;
}

.change-municipality-text {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 0.5rem !important;
}

.municipality-info-text {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
    text-align: center;
}

/* Detection Message */
.detection-message {
    background-color: #d5dbdb;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.detection-message h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.detection-message p {
    color: #34495e;
    line-height: 1.6;
}

/* Poll Section */
.poll-section {
    background: white;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
}

.poll-question {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #2c3e50;
    text-align: center;
}

/* Poll Options */
.poll-options {
    display: grid;
    gap: 1rem;
}

.poll-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.poll-option:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.poll-option.selected {
    border-color: #3498db;
    background-color: #e3f2fd;
}

.poll-option input[type="radio"] {
    margin-right: 1rem;
    transform: scale(1.2);
}

.poll-option label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    font-weight: 500;
}

.candidate-name {
    font-weight: 600;
    color: #2c3e50;
}

.party-info {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: normal;
    margin-top: 0.25rem;
}

/* Party Logos */
.party-logo {
    width: 32px;
    height: 32px;
    margin-right: 0.75rem;
    vertical-align: middle;
    border-radius: 4px;
    object-fit: contain;
    border: 1px solid #bdc3c7;
}

/* Status Messages */
.success {
    background-color: #d5f4e6;
    border: 2px solid #27ae60;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.success h2 {
    color: #27ae60;
    margin-bottom: 1rem;
}

.success p {
    color: #229954;
    font-size: 1.1rem;
}

.error {
    background-color: #fadbd8;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.error h2 {
    color: #e74c3c;
    margin-bottom: 1rem;
}

.error p {
    color: #c0392b;
    font-size: 1.1rem;
}

.already-voted {
    background-color: #d5f4e6;
    border: 2px solid #27ae60;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
}

.already-voted h3 {
    color: #27ae60;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.already-voted p {
    color: #229954;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.no-candidates {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
    font-style: italic;
}

/* Statistics */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    border: 2px solid #bdc3c7;
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

/* Municipality Results */
.municipality-results {
    margin-top: 2rem;
}

.municipality-card {
    background: white;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.municipality-header {
    background-color: #ecf0f1;
    padding: 1.5rem;
    border-bottom: 2px solid #bdc3c7;
}

.municipality-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.total-votes {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.candidate-results {
    padding: 1.5rem;
}

.candidate-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    position: relative;
}

.candidate-name {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.candidate-votes {
    margin-right: 0.75rem;
    font-weight: bold;
    color: #3498db;
    min-width: 50px;
    text-align: right;
    font-size: 0.9rem;
}

.candidate-percent {
    font-weight: bold;
    color: #27ae60;
    min-width: 45px;
    text-align: right;
    font-size: 0.9rem;
}

.progress-bar {
    flex: 2;
    height: 16px;
    background-color: #ecf0f1;
    border-radius: 8px;
    margin: 0 0.75rem;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transition: width 0.3s ease;
    border-radius: 8px;
}

/* Chart-style progress bars */
.chart-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chart-row {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #3498db;
    position: relative;
    overflow: hidden;
}

.chart-candidate-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
}

.chart-candidate-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85rem;
}

.chart-party-info {
    font-size: 0.75rem;
    color: #7f8c8d;
}

.chart-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 120px;
    position: relative;
    z-index: 2;
}

.chart-votes {
    font-weight: bold;
    color: #3498db;
    font-size: 0.85rem;
    min-width: 40px;
    text-align: right;
}

.chart-percent {
    font-weight: bold;
    color: #27ae60;
    font-size: 0.85rem;
    min-width: 40px;
    text-align: right;
}

.chart-progress {
    flex: 1;
    height: 12px;
    background-color: rgba(248, 249, 250, 0.3);
    border-radius: 6px;
    margin: 0 0.5rem;
    overflow: hidden;
    position: relative;
}

.chart-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transition: width 0.3s ease;
    border-radius: 6px;
}

/* Privacy Notice */
.privacy-notice {
    background-color: #f8f9fa;
    border: 2px solid #95a5a6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.privacy-notice h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background-color: #34495e;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

.footer a {
    color: #3498db;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 0.5rem 0; /* Reduced padding for mobile */
    }
    
    .header-container {
        flex-direction: row; /* Keep horizontal layout on mobile */
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
    
    .logo {
        flex: 1; /* Take available space */
    }
    
    .logo-img {
        height: 30px; /* Smaller logo on mobile */
    }
    
    .logo-text {
        font-size: 1.2rem; /* Smaller text on mobile */
    }
    
    .nav {
        display: none; /* Hidden by default on mobile */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #2c3e50;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        padding: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    
    .nav.show {
        display: flex !important; /* Show when toggled */
    }
    
    .nav a {
        text-align: center;
        padding: 0.75rem 1rem;
    }
    
    .mobile-menu-toggle {
        display: block;
        order: 2; /* Position on the right */
    }
    
    .container {
        padding: 0.25rem; /* Further reduced padding for mobile */
    }
    
    .card-content {
        padding: 0.5rem; /* Further reduced padding for mobile */
    }
    
    .card {
        margin-bottom: 0.75rem; /* Further reduced margin for mobile */
    }
    
    .card-header {
        padding: 0.75rem; /* Further reduced header padding for mobile */
    }
    
    .card-header h1 {
        font-size: 1.3rem; /* Smaller header on mobile */
        margin-bottom: 0.25rem; /* Reduced margin */
    }
    
    .card-header p {
        font-size: 0.9rem; /* Smaller subtitle on mobile */
    }
    
    .municipality-form {
        padding: 0.75rem; /* Further reduced form padding for mobile */
        margin-bottom: 0;
    }
    
    .municipality-form h3 {
        font-size: 1.1rem; /* Smaller form title on mobile */
        margin-bottom: 0.75rem; /* Reduced margin */
    }
    
    .selected-municipality-info {
        padding: 0.75rem; /* Reduced info box padding on mobile */
        margin-bottom: 0.75rem; /* Reduced margin */
    }
    
    .form-group {
        margin-bottom: 1rem; /* Reduced form group margin on mobile */
    }
    
    .form-group label {
        font-size: 0.9rem; /* Smaller label on mobile */
        margin-bottom: 0.25rem; /* Reduced margin */
    }
    
    .form-control {
        padding: 8px; /* Reduced input padding on mobile */
        font-size: 0.9rem; /* Smaller input text on mobile */
    }
    
    .btn {
        padding: 8px 16px; /* Reduced button padding on mobile */
        font-size: 0.9rem; /* Smaller button text on mobile */
    }
    
    .poll-section {
        padding: 1rem; /* Reduced poll section padding on mobile */
        margin-top: 1rem; /* Reduced margin on mobile */
    }
    
    .poll-question {
        font-size: 1.1rem; /* Smaller poll question on mobile */
        margin-bottom: 1rem; /* Reduced margin on mobile */
    }
    
    .poll-option {
        padding: 0.75rem; /* Reduced poll option padding on mobile */
    }
    
    .candidate-name {
        font-size: 0.9rem; /* Smaller candidate name on mobile */
    }
    
    .party-info {
        font-size: 0.8rem; /* Smaller party info on mobile */
    }
    
    .already-voted {
        padding: 1rem; /* Reduced already voted padding on mobile */
        margin: 1rem 0; /* Reduced margin on mobile */
    }
    
    .already-voted h3 {
        font-size: 1.2rem; /* Smaller already voted title on mobile */
    }
    
    .already-voted p {
        font-size: 0.9rem; /* Smaller already voted text on mobile */
    }
    
    .privacy-notice {
        padding: 0.75rem; /* Reduced privacy notice padding on mobile */
        margin-top: 0.75rem; /* Reduced margin on mobile */
        font-size: 0.8rem; /* Smaller privacy notice text on mobile */
    }
    
    .privacy-notice h4 {
        font-size: 0.9rem; /* Smaller privacy notice title on mobile */
        margin-bottom: 0.5rem; /* Reduced margin */
    }
    
    .detection-message {
        padding: 1rem; /* Reduced detection message padding for mobile */
        margin-bottom: 1rem; /* Reduced margin for mobile */
    }
    
    .stats-overview {
        gap: 0.75rem; /* Reduced gap for mobile */
        margin-bottom: 1rem; /* Reduced margin for mobile */
    }
    
    .stat-card {
        padding: 1rem; /* Reduced stat card padding for mobile */
    }
    
    .municipality-card {
        margin-bottom: 1rem; /* Reduced margin for mobile */
    }
    
    .municipality-header {
        padding: 1rem; /* Reduced header padding for mobile */
    }
    
    .candidate-results {
        padding: 1rem; /* Reduced results padding for mobile */
    }
    
    .candidate-row {
        padding: 0.75rem; /* Reduced row padding for mobile */
        margin-bottom: 0.75rem; /* Reduced margin for mobile */
    }
    
    .privacy-notice {
        padding: 1rem; /* Reduced privacy notice padding for mobile */
        margin-top: 1rem; /* Reduced margin for mobile */
    }
    
    .stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem; /* Use the reduced gap we set earlier */
    }
    
    .candidate-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.75rem; /* Keep the reduced padding we set earlier */
        margin-bottom: 0.75rem; /* Keep the reduced margin we set earlier */
    }
    
    .chart-container {
        gap: 0.25rem; /* Reduced gap for mobile */
    }
    
    .chart-row {
        padding: 0.4rem; /* Reduced padding for mobile */
        margin-bottom: 0.25rem; /* Reduced margin for mobile */
    }
    
    .chart-candidate-name {
        font-size: 0.8rem; /* Smaller candidate name on mobile */
    }
    
    .chart-party-info {
        font-size: 0.7rem; /* Smaller party info on mobile */
    }
    
    .chart-stats {
        gap: 0.5rem; /* Reduced gap for mobile */
        min-width: 100px; /* Reduced min-width for mobile */
    }
    
    .chart-votes, .chart-percent {
        font-size: 0.8rem; /* Smaller stats text on mobile */
        min-width: 35px; /* Reduced min-width for mobile */
    }
    
    .chart-progress {
        height: 10px; /* Smaller progress bar on mobile */
        margin: 0 0.25rem; /* Reduced margin for mobile */
    }
    
    .candidate-name {
        margin-bottom: 0.5rem;
    }
    
    .candidate-votes,
    .candidate-percent {
        text-align: left;
        margin: 0.25rem 0;
    }
    
    .progress-bar {
        margin: 0.5rem 0;
    }
    
    .poll-option {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .poll-option input[type="radio"] {
        margin: 0 0 0.5rem 0;
    }
}

@media (max-width: 480px) {
    .card-header h1 {
        font-size: 20px;
    }
    
    .poll-question {
        font-size: 1.1rem;
    }
    
    .stat-card .number {
        font-size: 2rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}
