/*
Theme Name: Kenya Voter Locator
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: A WordPress theme for finding voter registration centres and viewing election candidates in Kenya
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kenya-voter
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.site-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.site-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.site-nav a:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Map Container */
.map-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 600px;
}

.map-controls {
    padding: 20px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.distance-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.distance-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2a5298;
    cursor: pointer;
}

.distance-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2a5298;
    cursor: pointer;
    border: none;
}

.distance-value {
    font-size: 18px;
    font-weight: bold;
    color: #2a5298;
    margin-top: 5px;
}

.view-toggle {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.view-btn {
    padding: 10px 20px;
    background: #2a5298;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.view-btn:hover {
    background: #1e3c72;
}

.view-btn.active {
    background: #1e3c72;
}

/* List View */
.centres-list {
    display: none;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
}

.centres-list.active {
    display: block;
}

.centre-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.3s;
}

.centre-item:hover {
    background-color: #f9f9f9;
}

.centre-item:last-child {
    border-bottom: none;
}

.centre-name {
    font-weight: 600;
    font-size: 16px;
    color: #2a5298;
    margin-bottom: 5px;
}

.centre-address {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.centre-distance {
    color: #888;
    font-size: 12px;
}

/* Candidate Cards */
.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.candidate-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.candidate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.candidate-card.expanded {
    position: relative;
    z-index: 10;
}

.candidate-header {
    padding: 20px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.candidate-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
}

.candidate-info h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
}

.candidate-party {
    font-size: 14px;
    opacity: 0.9;
}

.candidate-body {
    padding: 20px;
}

.candidate-position {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.candidate-section {
    margin-bottom: 15px;
}

.candidate-section h4 {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.candidate-section p,
.candidate-section ul {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.candidate-section ul {
    list-style: none;
    padding-left: 0;
}

.candidate-section ul li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.candidate-section ul li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #2a5298;
    font-weight: bold;
}

.view-more-btn {
    background: #2a5298;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.view-more-btn:hover {
    background: #1e3c72;
}

.candidate-expanded {
    display: none;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.candidate-expanded.active {
    display: block;
}

.voting-history-item {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 10px;
}

.voting-history-item strong {
    color: #2a5298;
}

/* Page Title */
.page-title {
    font-size: 32px;
    color: #2a5298;
    margin: 30px 0 20px 0;
    text-align: center;
}

.page-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* Position Filter */
.position-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #2a5298;
    color: #2a5298;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    background: #2a5298;
    color: white;
}

/* Footer */
.site-footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

/* Chatbot Styles */
.chatbot-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.chatbot-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.chatbot-header h2 {
    color: #2a5298;
    margin-bottom: 10px;
}

.chatbot-messages {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.chat-message {
    margin-bottom: 20px;
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    justify-content: flex-end;
}

.bot-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
}

.user-message .message-content {
    background: #2a5298;
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin: 0 0 10px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 5px 0;
}

.message-content strong {
    color: #2a5298;
    font-weight: 600;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

.chatbot-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.chatbot-input:focus {
    border-color: #2a5298;
}

.chatbot-send-btn {
    padding: 12px 24px;
    background: #2a5298;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.chatbot-send-btn:hover {
    background: #1e3c72;
}

.chatbot-suggestions {
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.chatbot-suggestions p {
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.suggestion-chip {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    color: #555;
}

.suggestion-chip:hover {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .site-nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    #map {
        height: 400px;
    }
    
    .candidates-grid {
        grid-template-columns: 1fr;
    }
    
    .position-filter {
        justify-content: flex-start;
    }
    
    .chatbot-messages {
        height: 400px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .suggestion-chips {
        flex-direction: column;
    }
    
    .suggestion-chip {
        width: 100%;
        text-align: left;
    }
}
