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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
 
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
  
 
}

/* =========================
   MAIN LAYOUT
========================= */

.container {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    height: 100vh;
    overflow: hidden;
    gap: 1px;
    background-color: #e0e0e0;
}

/* =========================
   SIDEBARS
========================= */

.sidebar {
    background-color: #ffffff;
    padding: 20px;
    overflow-y: auto;
}

/* LEFT SIDEBAR */

.left-sidebar {
    border-right: 1px solid #ddd;
}

.sidebar-header {
    margin-bottom: 20px;
}

.home-btn {
    width: 100%;
    padding: 10px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background-color: #0066cc;
    color: white;
    cursor: pointer;
}

.home-btn:hover {
    background-color: #0052a3;
}

/* Election Tabs */

.election-tabs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.election-tab {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    cursor: pointer;
    text-align: left;
}

.election-tab.active {
    background-color: #0066cc;
    color: white;
    border-color: #0066cc;
}

/* =========================
   GENERAL AI PANEL
========================= */

.general-ai-panel {
    margin-top: 25px;
    border-top: 1px solid #eee;
    padding-top: 15px;

    display: flex;
    flex-direction: column;
    height: 320px;
}

.general-ai-panel h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.general-ai-note {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}
/* Expanded mode */
.general-ai-panel.expanded {
    position: fixed;
    top: 0;
    left: 0;
    width: 600px;
    height: 80vh;
    z-index: 1000;
    background: white;
    border-right: 1px solid #ddd;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    border-radius: 14px;
}

/* Make messages fill space when expanded */
.general-ai-panel.expanded .general-ai-messages {
    max-height: none;
    flex: 1;
    
}
/* Messages */

.general-ai-messages {
    flex: 1;
    overflow-y: auto;
    background: #f9fbff;
    border: 1px solid #e1e8f0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;

  

    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Message bubbles */

.general-ai-message {
    margin-bottom: 8px;
    font-size: 14px;

    max-width: 85%;
    padding: 10px 12px;
    border-radius: 16px;
    line-height: 1.4;
    word-wrap: break-word;
}

.general-ai-message.user {
    

    align-self: flex-end;
    background-color: #0066cc;
    color: white;
    border-bottom-right-radius: 4px;
}

.general-ai-message.bot {
    

    align-self: flex-start;
    background-color: #e9ecef;
    color: #222;
    border-bottom-left-radius: 4px;
}

/* Input row */

.general-ai-input-row {
    display: flex;
    gap: 8px;

   

    margin-top: 10px;
}

.general-ai-input-row input {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;

    
}

.general-ai-input-row button {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #0066cc;
    color: white;
    cursor: pointer;

  
}

.general-ai-input-row button:hover {
    background: #0052a3;
}

/* =========================
   MAIN CHAT AREA
========================= */

.main-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    overflow: hidden;
    height: 100vh;
}

.chatbot-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    flex: 1;   
    min-height: 0;
    background: white;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    overflow: hidden;
}

/* Header */

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.chat-header h1 {
    font-size: 22px;
}

.chat-header p {
    font-size: 14px;
    color: #666;
}

/* Messages */


.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Base message */
.message {
    display: flex;
    width: 100%;
}

/* Message content (shared style) */
.message-content {
   

    padding: 16px 18px;

    font-size: 15px;
    line-height: 1.65;

    border-radius: 10px;

    white-space: pre-wrap;
    animation: fadeIn 0.2s ease;
}

/* USER MESSAGE — minimal, subtle */
.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: #f1f5f9;
    color: #1a1a1a;

    border: 1px solid #e2e8f0;
    text-align: left;

    max-width: 520px;   /* narrower, like input */
    width: auto;
}

/* BOT MESSAGE — primary content focus */
.bot-message {
    justify-content: flex-start;
}

.bot-message .message-content {
    background: #ffffff;
    color: #2c3e50;

    border: 1px solid #e3e8ef;

    box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}

/* Subtle entry animation */
.message-content {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Suggested questions */

.suggested-questions {
    padding: 10px 20px;
    border-top: 1px solid #eee;
}

.suggested-question-bubble {
    margin: 5px;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    cursor: pointer;
}

.suggested-question-bubble:hover {
    background: #eee;
}

/* Input */

.chat-input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid #eee;
}

.chat-input-area input {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.send-btn {
    margin-left: 10px;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    background-color: #0066cc;
    color: white;
    cursor: pointer;
}

/* =========================
   RIGHT SIDEBAR (leave mostly as-is)
========================= */

.right-sidebar {
    border-left: 1px solid #ddd;
}

/* Candidate cards spacing fix */

.candidates-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
/*=========================
   Candidate Cards
========================= */

.candidate-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.candidate-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.candidate-name {
    font-weight: 600;
    font-size: 16px;
    text-align: center;
}

.candidate-image {
    width: 100%;
    max-width: 140px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* =========================
   Hover Tooltip
========================= */

.tooltip-wrapper {
    position: relative;
    display: inline-block;
    margin-top: 10px;
}

.view-profile-btn {
    padding: 8px 12px;
    border: none;
    background-color: #0066cc;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.view-profile-btn:hover {
    background-color: #0052a3;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;

    width: 220px;
    background-color: #2c3e50;
    color: #fff;
    text-align: center;

    border-radius: 6px;
    padding: 8px;

    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);

    font-size: 12px;
    line-height: 1.4;

    transition: opacity 0.2s ease;
}

.tooltip-wrapper:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* =========================
   Profile Modal
========================= */

.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.profile-modal-content {
    background: #fff;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;

    overflow-y: auto;

    border-radius: 10px;
    padding: 20px;
}

.modal-title {
    font-size: 20px;
    margin-bottom: 12px;
}

.modal-text {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.modal-close-btn {
    float: right;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

.toggle-ai-btn {
    background: none;
    border: none;
    color: #0066cc;
    cursor: pointer;
    font-size: 13px;
    margin-bottom: 8px;
    text-align: right;
}

/*WELCOME PAGE */
.welcome-container {
    position: relative;


    margin: 0;
    display: flex; 
    width: 100%;
 
    min-height: 100vh;
    overflow: visible;

    display: flex;

    padding: 10px;

    justify-content: center;

  
    align-items: flex-start;

    background-color: #f5f5f5;

    overflow-y: auto;
}

.welcome-content {
    width: 100%;
    max-width: 1400px;
    

    display: grid;
    grid-template-columns: 1fr 2fr;  /* LEFT = 1/3, RIGHT = 2/3 */
    align-items: start;

    gap: 20px;

    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);

    padding: 16px;           
    overflow: visible;

  
}

.welcome-left,
.welcome-right {
    overflow-y: auto;
    min-height: 0; /* IMPORTANT for grid overflow fixes */
    padding: 10px 15px;
    box-sizing: border-box;
    align-self: start;
    min-height: 0;
    overflow: visible;
}

.welcome-content h1 {
    font-size: 40px;
    margin-bottom: 12px;
    color: #1a1a1a;

    margin-top: 0;
}

.welcome-content p {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.welcome-subtitle {
    font-size: 18px;
    font-weight: 500;

    color: #4a5a6a;

    text-align: center;

    margin-top: 6px;
    margin-bottom: 18px;

    letter-spacing: 0.3px;

    max-width: 600px;
    margin-left: auto;
    margin-right: auto;

    line-height: 1.4;

    position: relative;
}

/* subtle divider feel under subtitle */
.welcome-subtitle::after {
    content: "";
    display: block;

    width: 80px;
    height: 2px;

    margin: 12px auto 0 auto;

    background: linear-gradient(90deg, transparent, #c9d7ea, transparent);
    border-radius: 2px;
}

.learning_more {
    width: 100%;
    max-width: 800px;
    margin: 25px auto;

    text-align: left;

    background-color: #f9fbff;
    border: 1px solid #d9e5f2;
    border-radius: 8px;
    padding: 18px;

    line-height: 1.6;
    font-size: 14px;
    color: #2c3e50;
}


/* Section headings */
.learning_more h3 {
    font-size: 17px;
    font-weight: 600;
    color: #123a63;

    margin-top: 16px;
    margin-bottom: 6px;
}

/* Paragraphs */
.learning_more p {
    margin-bottom: 12px;
    color: #445566;
}

/* Slight visual separation between sections */
.learning_more h3:not(:first-child) {
    border-top: 1px solid #e3edf7;
    padding-top: 14px;
}

.welcome-district-image {
    width: 100%;
    max-width: 850px;
    margin: 10px auto;
    display: block;

    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    background: #fff;
    transition: all 0.2s ease;

}

.county-section {
    margin-top: 25px;

    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.county-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.county-section label {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

/* input styling (important) */
#county-input {
    padding: 12px 14px;
    border: 1px solid #cfd6e4;
    border-radius: 8px;

    font-size: 16px;
    font-weight: 500;

    color: #2c3e50;
    background-color: #fff;

    transition: 0.2s ease;
    width: 100%;
    border-radius: 10px;
    font-size: 16px;
}

#county-input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.county-suggestion-item {
    padding: 10px 12px;
 
    font-weight: 500;
  

    font-size: 16px;
  

    color: #2c3e50;

    border-radius: 8px;

    cursor: pointer;

    transition: all 0.15s ease;
}

/* hover clarity */
.county-suggestion-item:hover {
    background: #eef4ff;
    color: #0b4fa3;

    cursor: pointer;
}

.county-suggestion-item:active {
    background: #dce9ff;
}

/* Optional: nicer scrollbar */
.county-suggestions::-webkit-scrollbar {
    width: 6px;
}

.county-suggestions::-webkit-scrollbar-thumb {
    background: #c7d3e6;
    border-radius: 10px;
}

.county-suggestions::-webkit-scrollbar-thumb:hover {
    background: #aebed8;
}

.county-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;

    background: #ffffff;

    background-color: white;
    border: 1px solid #ddd;
  
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999;
   
    border-radius: 10px;

    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);

    max-height: 220px;
    padding: 6px;

}

.county-suggestions.hidden {
    display: none;
}

.district-selection.hidden {
    display: none;
}

.explore-button.hidden {
    display: none;
}

.privacy-note {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    margin-bottom: 10px;
    text-align: center;
    max-width: 320px;
    line-height: 1.3;
    font-weight: 400;
}



/* =========================
   Info Toggle Buttons
   ========================= */

   .info-toggle {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    margin-top: 12px;

    border: 1px solid #d0d7e2;
    border-radius: 8px;
    background-color: #f4f7fb;

    font-size: 15px;
    font-weight: 600;
    cursor: pointer;

    transition: all 0.2s ease;
}

.info-toggle:hover {
    background-color: #e8f0ff;
}

/* hidden content */
.info-panel.hidden {
    display: none;
}

.info-panel {
    padding: 12px 14px;
    margin-top: 6px;
    margin-bottom: 10px;

    border-left: 3px solid #0066cc;
    background: #fafcff;

    font-size: 14px;
    line-height: 1.5;
}

#district-options {
    display: flex;
    flex-direction: column;
    gap: 8px;

    margin-top: 10px;
}

/* each district option */
.district-option-label {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 12px;

    border: 1px solid #ddd;
    border-radius: 8px;

    background-color: #f9fbff;

    cursor: pointer;

    transition: all 0.2s ease;
}

/* hover effect */
.district-option-label:hover {
    background-color: #e8f0ff;
    border-color: #bcd3ff;
}

/* radio button alignment fix */
.district-option-label input {
    transform: scale(1.1);
}

/* selected state (optional but nice) */
.district-option-label:has(input:checked) {
    border-color: #0066cc;
    background-color: #eaf2ff;
}

.explore-button {
    margin-top: 18px;
    padding: 14px 18px;

    font-size: 16px;
    font-weight: 700;

    color: white;
    background: linear-gradient(135deg, #0066cc, #004a99);

    border: none;
    border-radius: 10px;

    cursor: pointer;

    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.25);

    transition: all 0.2s ease;

    width: 100%;
    max-width: 320px;
}

/* hover effect */
.explore-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 102, 204, 0.35);
    background: linear-gradient(135deg, #0073e6, #0056b3);
}

/* click effect */
.explore-button:active {
    transform: translateY(0px);
    box-shadow: 0 4px 10px rgba(0, 102, 204, 0.2);
}


.learning_more p1{
    background: #f9fbff;
    border-left: 4px solid #0066cc;

    padding: 16px 18px;
    border-radius: 8px;

    display: flex;
    flex-direction: column;
    gap: 12px;

    font-size: 14px;
    line-height: 1.6;
    color: #2c3e50;
}