/**
 * Realtime Voice Chat Styles - UX Overhaul Edition
 */

/* ==========================================================================
   HERO WELCOME SECTION - First-time User Experience
   ========================================================================== */
main {
    font-family: "Aspekta", "Inter", sans-serif;
}

.llm-hero-welcome {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 50px 40px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    animation: fadeInUp 0.6s ease-out;
    margin-bottom: 30px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.hero-title {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 16px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 18px;
    line-height: 1.6;
    margin: 0 0 40px 0;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Conversation Starters */
.conversation-starters {
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.starters-label {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 20px 0;
    opacity: 0.9;
}

.starter-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.starter-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.starter-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.starter-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.starter-icon {
    font-size: 22px;
}

/* Quick Start Guide */
.quick-start-guide {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 40px 0;
    flex-wrap: wrap;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.guide-step:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.step-number {
    width: 36px;
    height: 36px;
    background: white;
    color: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.step-content strong {
    font-size: 16px;
    font-weight: 700;
    display: block;
}

.step-content span {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
}

/* Hero CTA Button */
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 48px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    margin-top: 40px;
}

.hero-cta:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

.hero-cta:active {
    transform: translateY(-2px) scale(1.02);
}

.cta-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.hero-cta:hover .cta-icon {
    transform: translateX(5px);
}

/* Main Interface - Progressive Disclosure */
.llm-main-interface {
    animation: fadeInUp 0.6s ease-out;
}

/* ==========================================================================
   STATUS & HINTS
   ========================================================================== */

.status-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #856404;
    animation: slideIn 0.5s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hint-icon {
    font-size: 20px;
}

.activity-hint {
    margin-top: 12px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    animation: pulse 2s ease-in-out infinite;
}

.beta-badge {
    width:100%;
    pointer-events: none;
    display: flex;
    justify-content: center;
    pointer-events:none;
}

.beta-badge-item{
    padding: 3px 10px;
    border: 1px solid #242424;
    border-radius: 50px;
    font-size: 8px;
    opacity: 0.4;
    background:#242424;
    color:#FAFAFA;
    font-weight:500;
}

/* ==========================================================================
   NO ACCESS TEMPLATE
   ========================================================================== */
.no-access{
    z-index: 2;
}

.login-buttons {
    display:flex;
    flex-direction:column;
    justify-content: center;
    align-items: center;
    gap:10px;
    width:fit-content;
    margin:0 auto;
}

.login-buttons a {
    padding: 3px 10px;
    border: 1px solid #242424;
    border-radius: 4px;
    color:#242424;
    width:100%;
    text-align:center;
}

.login-buttons a:hover{
    background:#242424;
    color:#FAFAFA;
}

/* ==========================================================================
   MODE SWITCHER - Enhanced
   ========================================================================== */

.mode-title {
    margin: 0 0 12px 0;
    font-size: 22px;
    color: #333;
    font-weight: 700;
}

.mode-subtitle {
    margin: 0 0 20px 0;
    font-size: 15px;
    color: #666;
}

.mode-benefit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==========================================================================
   CONTROL BUTTONS - Contextual Help
   ========================================================================== */

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.primary-control {
    flex: 1;
}

.secondary-controls {
    display: flex;
    gap: 15px;
    animation: fadeInScale 0.4s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.control-tooltip {
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.3s forwards;
}

/* ==========================================================================
   TEXT MODE - Enhanced UX
   ========================================================================== */

.text-mode-welcome {
    margin-bottom: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 12px;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-welcome-message {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 14px;
    color: #1565c0;
    font-weight: 600;
}

.welcome-icon {
    font-size: 22px;
}

kbd {
    padding: 3px 8px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-mode-hints {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding: 0 4px;
}

.hint-item {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

#char-counter {
    font-weight: 600;
    color: #667eea;
}

/* ==========================================================================
   CONVERSATION DISPLAY - Better Empty States
   ========================================================================== */

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.message-count {
    font-size: 13px;
    color: #6c757d;
    font-weight: 600;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 20px;
}

.btn-clear {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.clear-icon {
    font-size: 16px;
}

.conversation-placeholder {
    text-align: center;
    padding: 60px 30px;
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
}

.placeholder-title {
    font-size: 18px;
    font-weight: 700;
    color: #495057;
    margin: 0 0 8px 0;
}

.placeholder-hint {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}

/* ==========================================================================
   HOW IT WORKS - Collapsible with Better Design
   ========================================================================== */

.how-it-works-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 0;
    margin-top: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.how-it-works-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    font-size: 16px;
    font-weight: 700;
    color: #495057;
    transition: all 0.3s ease;
}

.how-it-works-toggle:hover {
    color: #667eea;
}

.how-it-works-toggle::-webkit-details-marker {
    display: none;
}

.toggle-icon-expand {
    font-size: 24px;
}

.toggle-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.how-it-works-section[open] .toggle-arrow {
    transform: rotate(180deg);
}

.how-it-works-section[open] .knowledge-flow {
    padding: 0 24px 24px;
    animation: fadeInDown 0.4s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flow-desc {
    font-size: 11px;
    color: #868e96;
    margin-top: 4px;
    font-weight: 500;
}

.flow-description {
    margin: 20px 24px 24px;
    text-align: center;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    padding: 16px;
    background: white;
    border-radius: 10px;
}

/* Navigation Tabs */
.llm-chat-navigation {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0;
}

.llm-chat-nav-tabs {
    display: flex;
    gap: 10px;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.llm-nav-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    color: #6c757d;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.llm-nav-tab:hover {
    background: #ffffff;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.llm-nav-tab.active {
    background: #667eea;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.llm-nav-tab .nav-icon {
    font-size: 20px;
}

.llm-nav-tab .nav-text {
    font-size: 15px;
}

@media (max-width: 768px) {
    .llm-chat-nav-tabs {
        flex-direction: column;
        gap: 8px;
    }

    .llm-nav-tab {
        width: 100%;
    }
}

.llm-realtime-page {
    margin: 0 auto;
    padding: 20px;
    background: #FFFFFF;

    min-height: calc(100vh - 66px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.llm-realtime-container {
    margin: 0 auto;
    max-width: 680px;
    width: 100%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap:10px;
}

/* Status Display */
.llm-realtime-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    gap: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

/* AI Activity Indicator - Main UI */
.ai-activity-main {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    z-index:1;
}

/* Rive Animation Canvas */
.rive-animation-canvas {
    width: 800px;
    height: 600px;
    max-width: 100%;
    display: block;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dc3545;
    animation: pulse-red 2s infinite;
}

.status-indicator.connected .status-dot {
    background: #28a745;
    animation: pulse-green 2s infinite;
}

.status-indicator.connecting .status-dot {
    background: #ffc107;
    animation: pulse-yellow 1s infinite;
}

.rive-animation-canvas.scale-down {
    transform: scale(0.3);
}

@keyframes pulse-red {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes pulse-green {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes pulse-yellow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Audio Level */
.audio-level {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 300px;
}

.level-label {
    font-size: 14px;
    color: #6c757d;
    white-space: nowrap;
}

.level-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.level-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #28a745, #ffc107, #dc3545);
    transition: width 0.1s ease;
}

/* Initial Greeting Text */
.initial-greeting-text {
    text-align: center;
    font-size: 2em;
    font-weight: 500;
    line-height: 1.25em;
    margin-bottom: 10px;
    z-index: 3;
}

/* How It Works Section */
.how-it-works-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.how-it-works-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
    text-align: center;
    font-weight: 700;
}

.knowledge-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    min-width: 100px;
    transition: all 0.3s ease;
}

.flow-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.flow-icon {
    font-size: 28px;
}

.flow-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-align: center;
    line-height: 1.3;
}

.flow-arrow {
    font-size: 24px;
    color: #667eea;
    font-weight: bold;
}

.flow-description {
    margin: 0;
    text-align: center;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .knowledge-flow {
        flex-direction: column;
        gap: 8px;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .flow-step {
        width: 100%;
        max-width: 200px;
    }
}

/* Text & Mode Toggle Container */
.llm-input-and-mode-toggle-container {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 4px;
    border: 1px solid #A7A7A7;
    border-radius: 6px;
    z-index:5;
}

/* Mode Switcher */
.llm-usage-remaining {
    display: block !important;
    visibility: visible !important;
    text-align: center !important;
    font-size: 10px !important;
    color: #555 !important;
    line-height: 1.6 !important;
}

.llm-usage-remaining .usage-item {
    display: inline !important;
}

.llm-usage-remaining .usage-sep {
    display: inline !important;
    margin: 0 12px !important;
    opacity: 0.8;
}

.llm-usage-remaining strong {
    color: #333 !important;
    font-weight: 600 !important;
}

button.mode-toggle-btn {
    border-color:#A7A7A7;
    color: #242424;
    font-size:10px;
    border-radius:4px;
    display: flex;
    gap: 6px;
    align-items: center;
}

button.mode-toggle-btn:hover,
button.mode-toggle-btn:focus{
    background-color: #242424;
    border-color:#242424;
    color:white;
}

.mode-icon {
    display: flex;
    align-items: center;
    fill:#242424;
}

button.mode-toggle-btn:hover .mode-icon,
button.mode-toggle-btn:focus .mode-icon{
    fill:white;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Text Mode Container */
.llm-text-mode-container {
    width: 100%;
}

/* Text Input Form */
.text-mode-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.text-input-wrapper {
    display: flex;
    gap: 6px;
    align-items: stretch;
    width: 100%;
    justify-content: center;
}

.text-mode-input {
    font-family: inherit;
    padding: 4px;
    border: none;
    resize: none;
    margin:auto 0;
}

.text-mode-input:focus {
    outline: none;
}

.text-mode-input:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.6;
}

.text-mode-input::placeholder {
    color: #adb5bd;
}

button.text-mode-send-btn {
    background-color: #5c5c5c;
    border-color:#5c5c5c;
    color: white;
    font-size:10px;
    border-radius:4px;
    display:flex;
    gap:6px;
    align-items: center;
}

button.text-mode-send-btn:hover,
button.text-mode-send-btn:focus{
    background-color: #242424;
    border-color:#242424;
    cursor: pointer;
}

.btn-icon {
    display: flex;
    align-items: center;
    fill:white;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.text-mode-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* RAG Tier Status Display */
.rag-status-container {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.rag-tier-badge {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rag-tier-badge.tier-1 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.rag-tier-badge.tier-2 {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

.rag-tier-badge.tier-2.inactive {
    background: #e5e7eb;
    color: #6b7280;
    box-shadow: none;
}

.rag-tier-note {
    font-size: 12px;
    color: #6c757d;
    margin: 8px 0 0 0;
    padding-left: 4px;
}

.settings-group {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.settings-group summary {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-group summary::-webkit-details-marker {
    display: none;
}

.settings-group[open] summary {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.settings-content {
    display: grid;
    gap: 15px;
}

.setting-item {
    display: grid;
    gap: 8px;
}

.setting-item label {
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

.setting-control {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease;
}

.setting-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.setting-control {
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.setting-note {
    font-size: 13px;
    color: #6c757d;
    margin: 10px 0 0;
    font-style: italic;
}

/* Control Panel */
.llm-realtime-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    z-index:2;
    margin-top:-50px;
}

button.realtime-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 4px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #242424;
    border: none;
    border-radius: 6px;
    background: transparent;
    opacity: 0.6;
    cursor: pointer;
    box-sizing: border-box;
    transition: opacity 0.25s ease;
    transform: translateZ(0);
}

button.realtime-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

button.realtime-btn:hover:not(:disabled) {
    opacity: 1;
    background:rgba(0,0,0,0);
    box-shadow:none;
}

.realtime-btn-primary:hover:not(:disabled),
.realtime-btn-primary:focus:not(:disabled){
    color:#42B649;
    background:none;
}

.realtime-btn-secondary:hover:not(:disabled),
.realtime-btn-secondary:hover:not(:disabled){
    color:#E91A52;
    background:none;
}

.realtime-btn-warning:hover:not(:disabled),
.realtime-btn-warning:focus:not(:disabled){
    color:#242424;
    background:none;
}

/* Conversation Display */
.llm-realtime-conversation {
    height: calc(100vh - 330px);
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px 6px 0 0;
    z-index: 4;
}

/* Typing Indicator for Text Mode */
.conversation-message.typing-indicator {
    animation: fadeIn 0.3s ease;
}

.typing-animation {
    display: flex;
    gap: 6px;
    padding: 8px 0;
}

.typing-animation span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-animation span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-animation span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.btn-toggle-conversation {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 600;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-toggle-conversation:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.toggle-text {
    font-size: 15px;
}

.btn-clear {
    padding: 10px 16px;
    font-size: 14px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-clear:hover {
    background: #c82333;
}

.conversation-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding:15px;
}

.conversation-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.conversation-placeholder p {
    margin: 10px 0;
    font-size: 16px;
}

.placeholder-hint {
    font-size: 14px !important;
    color: #adb5bd !important;
}

.conversation-message {
    padding: 12px 16px;
    border-radius: 8px;
    max-width: 80%;
    word-wrap: break-word;
    animation: slideIn 0.3s ease;
}

.conversation-message:last-child {
    margin-bottom: 20px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.conversation-message.user {
    background: #667eea;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.conversation-message.assistant {
    background: #ffffff;
    color: #212529;
    border: 1px solid #dee2e6;
    align-self: flex-start;
}

.conversation-message.system {
    background: #ffc107;
    color: #212529;
    align-self: center;
    font-size: 14px;
    font-style: italic;
}

.message-role {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 4px;
}

.message-text {
    line-height: 1.6;
    word-wrap: break-word;
}

/* Formatted message content */
.message-text p {
    margin: 0 0 12px 0;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text strong {
    font-weight: 700;
    color: inherit;
}

.message-text .formatted-list {
    margin: 12px 0;
    padding-left: 0;
    list-style: none;
}

.message-text .formatted-list li {
    margin: 8px 0;
    padding-left: 0;
    line-height: 1.5;
}

.message-text .numbered-item {
    display: flex;
    gap: 8px;
    padding-left: 8px;
}

.message-text .numbered-item .number {
    font-weight: 700;
    flex-shrink: 0;
    min-width: 24px;
}

.message-text .bullet-item {
    padding-left: 0;
    margin: 6px 0;
}

.message-text .bullet-item:before {
    content: "— ";
}

.conversation-message.assistant .message-text .bullet-item:before {
    color: #667eea;
}

.conversation-message.user .message-text .bullet-item:before {
    color: rgba(255, 255, 255, 0.8);
}

.message-timestamp {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

/* Text feedback (thumbs up/down) */
.llm-feedback {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.llm-feedback-btn {
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.llm-feedback-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.llm-feedback-status {
    font-size: 12px;
    color: #6c757d;
}

.llm-feedback-down-form {
    width: 100%;
    margin-top: 10px;
}

.llm-feedback-comment {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    resize: vertical;
    font-size: 13px;
}

.llm-feedback-down-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.llm-feedback-down-submit,
.llm-feedback-down-cancel {
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
}

.llm-feedback-down-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Source badges container */
.message-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    align-items: center;
}

.source-tier-label {
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Tier 1 - Website (Green) */
.message-sources.tier-1 .source-tier-label {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Tier 2 - National Building Code (Blue) */
.message-sources.tier-2 .source-tier-label {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.source-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.source-link:hover {
    background: #e5e7eb;
    color: #111827;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.source-ref {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: #f9fafb;
    color: #6b7280;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
}

/* Source type badge (post_type label) */
.source-type-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 3px;
    letter-spacing: 0.3px;
    line-height: 1;
    margin-right: 2px;
    flex-shrink: 0;
}

/* Post-type color coding */

/* PD 1096 - National Building Code (Amber) */
.source-link.post-type-pd-1096 {
    border-left: 3px solid #d97706;
    background: #fffbeb;
}

.source-link.post-type-pd-1096 .source-type-badge {
    background: #d97706;
    color: white;
}

/* RA 9514 - Fire Code (Red-Orange) */
.source-link.post-type-ra-9514 {
    border-left: 3px solid #dc2626;
    background: #fef2f2;
}

.source-link.post-type-ra-9514 .source-type-badge {
    background: #dc2626;
    color: white;
}

/* GBC - Green Building Code (Emerald) */
.source-link.post-type-gbc {
    border-left: 3px solid #059669;
    background: #ecfdf5;
}

.source-link.post-type-gbc .source-type-badge {
    background: #059669;
    color: white;
}

/* BP 220 / PD 957 - Housing (Blue-Purple) */
.source-link.post-type-bp-220-pd-957 {
    border-left: 3px solid #7c3aed;
    background: #f5f3ff;
}

.source-link.post-type-bp-220-pd-957 .source-type-badge {
    background: #7c3aed;
    color: white;
}

/* BP 344 - Accessibility (Teal) */
.source-link.post-type-bp-344 {
    border-left: 3px solid #0d9488;
    background: #f0fdfa;
}

.source-link.post-type-bp-344 .source-type-badge {
    background: #0d9488;
    color: white;
}

/* Page / Post - Vizcode Website (Slate Gray) */
.source-link.post-type-page,
.source-link.post-type-post {
    border-left: 3px solid #64748b;
    background: #f8fafc;
}

.source-link.post-type-page .source-type-badge,
.source-link.post-type-post .source-type-badge {
    background: #64748b;
    color: white;
}

/* Unknown / fallback */
.source-link.post-type-unknown {
    border-left: 3px solid #9ca3af;
    background: #f9fafb;
}

.source-link.post-type-unknown .source-type-badge {
    background: #9ca3af;
    color: white;
}

/* Debug Panel */


.llm-realtime-debug {
    margin-top: 20px;
    padding: 15px;
    background: #212529;
    color: #00ff00;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.debug-log {
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.btn-toggle-debug {
    display: block;
    margin: 20px auto 0;
    padding: 8px 16px;
    background: #343a40;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-toggle-debug:hover {
    background: #23272b;
}

/* Instructions */
.llm-realtime-instructions {
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 8px;
}

.llm-realtime-instructions h3 {
    margin-top: 0;
    color: #667eea;
}

.llm-realtime-instructions ol {
    margin: 15px 0;
    padding-left: 25px;
}

.llm-realtime-instructions li {
    margin: 8px 0;
    line-height: 1.6;
}

.instructions-note {
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border-radius: 4px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .llm-realtime-container {
        border-radius: 8px;
    }

    /* Hero Welcome Mobile */
    .llm-hero-welcome {
        padding: 40px 24px;
    }

    .hero-icon {
        font-size: 48px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .starter-buttons {
        flex-direction: column;
    }

    .starter-btn {
        width: 100%;
    }

    .quick-start-guide {
        flex-direction: column;
        gap: 16px;
    }

    .guide-step {
        max-width: 100%;
    }

    .llm-mode-switcher {
        padding: 20px 16px;
        margin-bottom: 25px;
    }

    .llm-realtime-status {
        flex-direction: column;
        gap: 15px;
        padding: 16px;
    }

    .status-hint {
        width: 100%;
        text-align: center;
    }

    .audio-level {
        max-width: 100%;
        width: 100%;
    }

    .llm-realtime-controls {
        gap: 12px;
    }

    .secondary-controls {
        flex-direction: column;
        width: 100%;
    }

    .control-item {
        width: 100%;
    }

    .conversation-message {
        max-width: 90%;
    }

    /* AI Activity Mobile */
    .activity-bars {
        height: 50px;
    }

    .activity-text {
        font-size: 18px;
    }

    /* Text mode responsive */
    .llm-realtime-conversation {
        height:calc(100vh - 450px);
    }

    button.mode-toggle-btn,
    button.text-mode-send-btn {
        font-size: 12px;
        justify-content:center;
        padding:12px;
    }

    .text-input-wrapper {
        flex-direction: column;
    }

    .text-input-row {
        flex-direction: column;
        gap: 12px;
    }

    .text-mode-input {
        width: 100%;
    }

    .text-mode-send-btn {
        width: 100%;
    }

    .mode-title {
        font-size: 18px;
    }

    .mode-subtitle {
        font-size: 14px;
    }
}

/* ==========================================================================
   ANIMATIONS & EFFECTS
   ========================================================================== */

/* Pulse highlight for attention */
.pulse-highlight {
    animation: pulseHighlight 1.5s ease-in-out;
}

@keyframes pulseHighlight {

    0%,
    100% {
        border:1px solid;
        transform: scale(1);
    }

    50% {
        border:1px solid;
        transform: scale(1.05);
    }
}

/* Starter button clicked effect */
.starter-btn.clicked {
    animation: clickedPulse 0.3s ease-out;
}

@keyframes clickedPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

/* Message fade in */
.conversation-message {
    animation: messageFadeIn 0.3s ease-out;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse highlight for attention */
.realtime-btn-highlight {
    animation: realtimeBtnHighlight 1.5s ease-in-out;
}

@keyframes realtimeBtnHighlight {

    0%,
    100% {
        background:rgba(66, 182, 73, 0.3);
        opacity:1;
    }

    50% {
        background:rgba(66, 182, 73, 0.5);
        opacity:0.6;
    }
}