/*
Theme Name: Judgment Navigator
Theme URI: https://ecsccaseguide.caribezyne.com
Author: Judgment Navigator Team
Author URI: https://ecsccaseguide.caribezyne.com
Description: Modern, responsive theme for Judgment Navigator - legal judgment search and discovery platform. Provides advanced search, filtering, and judgment detail views with AI-powered search.
Version: 2.0.0
License: GPL v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: judgment-navigator
Domain Path: /languages
*/

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e3a8a;
    --primary-hover: #1e40af;
    --secondary-color: #64748b;
    --accent-color: #3b82f6;
    --success-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease-in-out;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   LAYOUT & CONTAINERS
   ============================================ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #ffffff;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.025em;
    margin: 0;
}

.site-title a {
    color: #ffffff;
    text-decoration: none;
}

.site-title a:hover {
    color: #ffffff;
    opacity: 0.9;
}

.site-title:hover {
    opacity: 0.9;
}

.main-navigation {
    display: flex;
    align-items: center;
}

.primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.primary-menu li {
    margin: 0;
}

.primary-menu a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    display: block;
}

.primary-menu a:hover {
    color: #ffffff;
}

/* Responsive header */
@media (max-width: 768px) {
    .site-header {
        padding: 0.75rem 0;
    }
    
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .site-title {
        font-size: 1.125rem;
    }
    
    .main-navigation {
        width: 100%;
    }
    
    .primary-menu {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .primary-menu a {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.site-main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.search-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.search-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.search-section > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* ============================================
   SEARCH FORM
   ============================================ */
.search-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-input-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-button {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.search-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.search-button:active {
    transform: translateY(0);
}

.search-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   FILTERS
   ============================================ */
.filters-toggle {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1rem;
}

.filters-toggle:hover {
    background: var(--primary-color);
    color: #ffffff;
}

.filters-panel {
    display: none;
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filters-panel.active {
    display: grid;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group select,
.filter-group input {
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

.sort-controls label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.sort-controls select {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
}

/* ============================================
   RESULTS
   ============================================ */
.results-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.judgments-list {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: 1 column (2 per page) */
    gap: 1.5rem;
}

/* Tablet and Desktop: 3 columns (3 per page) */
@media (min-width: 768px) {
    .judgments-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.judgment-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.judgment-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.judgment-card-header {
    margin-bottom: 1rem;
}

.judgment-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.judgment-card-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.judgment-card-title a:hover {
    color: var(--accent-color);
}

.judgment-card-citation {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.judgment-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.judgment-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.judgment-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.judgment-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(30, 58, 138, 0.1);
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.judgment-card-link {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.judgment-card-link:hover {
    background: var(--primary-color);
    color: #ffffff;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================
   JUDGMENT DETAIL
   ============================================ */
/* ============================================
   SINGLE JUDGMENT DETAIL PAGE
   ============================================ */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: var(--transition);
    border-radius: var(--radius);
}

.back-link:hover {
    background: var(--bg-tertiary);
    color: var(--primary-hover);
}

.judgment-detail {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

/* Judgment Header */
.judgment-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.judgment-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.judgment-header-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.judgment-header-meta .meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.judgment-header-meta .meta-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.judgment-header-meta .meta-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.5;
}

.judgment-header-meta .meta-value ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.judgment-header-meta .meta-value ul li {
    padding: 0.25rem 0;
}

/* Judgment Sections */
.judgment-section {
    margin-bottom: 2.5rem;
}

.judgment-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tags-list .tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
}

.tags-list .tag:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* PDF Button */
.pdf-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.pdf-button:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Related Judgments */
.related-judgments {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 2px solid var(--border-color);
}

.related-judgments h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.related-judgments-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.related-judgments-list .judgment-card {
    cursor: pointer;
    transition: var(--transition);
}

.related-judgments-list .judgment-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.related-judgments-list .judgment-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.related-judgments-list .judgment-card .judgment-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.related-judgments-list .judgment-card .judgment-meta span {
    display: flex;
    gap: 0.5rem;
}

.related-judgments-list .judgment-card .judgment-meta strong {
    color: var(--text-primary);
    min-width: 70px;
}

/* Legacy support for existing classes */
.judgment-detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.judgment-detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.judgment-detail-citation {
    font-family: 'Courier New', monospace;
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.judgment-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.judgment-detail-section {
    margin-bottom: 2rem;
}

.judgment-detail-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.judgment-detail-section ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* ============================================
   LOADING & ERROR STATES
   ============================================ */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--text-primary);
    color: #ffffff;
    padding: 2rem 0;
    margin-top: 4rem;
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-footer p {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .site-title {
        font-size: 1.25rem;
    }
    
    .search-section {
        padding: 1.5rem;
    }
    
    .search-section h1 {
        font-size: 1.5rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-button {
        width: 100%;
    }
    
    .filters-panel {
        grid-template-columns: 1fr;
    }
    
    .judgment-card-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .judgment-card-link {
        width: 100%;
        text-align: center;
    }
    
    .judgment-detail-title {
        font-size: 1.5rem;
    }
    
    .judgment-detail-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .site-main {
        padding: 1rem 0;
    }
    
    .search-section {
        padding: 1rem;
    }
    
    .judgment-card {
        padding: 1rem;
    }
    
    .judgment-detail {
        padding: 1.5rem;
    }
    
    .judgment-header h1 {
        font-size: 1.5rem;
    }
    
    .judgment-header-meta {
        grid-template-columns: 1fr;
    }
    
    .related-judgments-list {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ============================================
   CHATBOT STYLES
   ============================================ */
.ecsc-chatbot-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: var(--transition);
}

.ecsc-chatbot-toggle:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.ecsc-chatbot-toggle:active {
    transform: scale(0.95);
}

.ecsc-chatbot-toggle-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}

.ecsc-chatbot-window {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 450px;
    height: 85vh;
    max-height: 650px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateY(100%);
    opacity: 0;
    transition: var(--transition);
}

.ecsc-chatbot-window.ecsc-chatbot-open {
    transform: translateY(0);
    opacity: 1;
}

@media (min-width: 640px) {
    .ecsc-chatbot-window {
        bottom: 1.5rem;
        right: 1.5rem;
        border-radius: 12px;
        height: 600px;
    }
}

.ecsc-chatbot-header {
    background: var(--text-primary);
    color: #ffffff;
    padding: 1rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.ecsc-chatbot-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ecsc-chatbot-header-title h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

.ecsc-chatbot-header-title p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.ecsc-chatbot-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.ecsc-chatbot-close:hover {
    color: #ffffff;
}

.ecsc-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ecsc-chatbot-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.ecsc-chatbot-message-user {
    align-self: flex-end;
    align-items: flex-end;
}

.ecsc-chatbot-message-bot {
    align-self: flex-start;
    align-items: flex-start;
}

.ecsc-chatbot-message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.ecsc-chatbot-message-user .ecsc-chatbot-message-bubble {
    background: var(--primary-color);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.ecsc-chatbot-message-bot .ecsc-chatbot-message-bubble {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.ecsc-chatbot-sources {
    margin-top: 0.5rem;
    max-width: 90%;
}

.ecsc-chatbot-sources-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ecsc-chatbot-sources-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ecsc-chatbot-source-link {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ecsc-chatbot-source-link:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-sm);
}

.ecsc-chatbot-form {
    padding: 0.75rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.ecsc-chatbot-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.ecsc-chatbot-input-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color);
}

.ecsc-chatbot-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.875rem;
    color: var(--text-primary);
    padding: 0;
}

.ecsc-chatbot-input::placeholder {
    color: var(--text-secondary);
}

.ecsc-chatbot-send {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.ecsc-chatbot-send:hover:not(:disabled) {
    background: var(--primary-hover);
}

.ecsc-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ecsc-chatbot-disclaimer {
    text-align: center;
    font-size: 0.625rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0 0;
}

.ecsc-chatbot-loading {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
}

.ecsc-chatbot-loading span {
    width: 4px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: ecsc-chatbot-bounce 1.4s infinite ease-in-out both;
}

.ecsc-chatbot-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.ecsc-chatbot-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes ecsc-chatbot-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.ecsc-chatbot-faq {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    max-height: 200px;
    overflow-y: auto;
}

.ecsc-chatbot-faq-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ecsc-chatbot-faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ecsc-chatbot-faq-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ecsc-chatbot-faq-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
    transform: translateX(2px);
}

.ecsc-chatbot-faq-item strong {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
}

.ecsc-chatbot-faq-item span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .ecsc-chatbot-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }
    
    .ecsc-chatbot-window {
        height: calc(100vh - 80px);
        max-height: none;
    }
}
