/* ============================================
   LIKABILITY SCORE - Modern Dark Theme
   ============================================ */

:root {
    /* Color palette - Deep ocean theme */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2234;
    --bg-card: #1e293b;
    
    --accent-primary: #22d3ee;
    --accent-secondary: #a855f7;
    --accent-gradient: linear-gradient(135deg, #22d3ee 0%, #a855f7 100%);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --border-color: #2d3748;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    
    /* Fonts */
    --font-display: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-display);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

/* Background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(34, 211, 238, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Layout
   ============================================ */

.app-container {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.logo-icon {
    font-size: 28px;
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.logo h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* API Status */
.api-status {
    margin-bottom: 32px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Active state - green dot */
.status-item.active .status-dot {
    background: var(--success) !important;
    box-shadow: 0 0 8px var(--success) !important;
}

/* Inactive state - gray dot */
.status-item.inactive .status-dot {
    background: var(--text-muted) !important;
    box-shadow: none !important;
}

/* Default state (if no class) - also gray */
.status-item:not(.active):not(.inactive) .status-dot {
    background: var(--text-muted) !important;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Quick Actions */
.quick-actions {
    flex: 1;
}

.quick-btn {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateX(4px);
}

/* Sidebar Footer */
.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.clear-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    border-color: var(--error);
    color: var(--error);
}

.version {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* ============================================
   Chat Container
   ============================================ */

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.chat-header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.chat-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.chat-header p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   Chat Messages
   ============================================ */

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

.message {
    display: flex;
    gap: 16px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.message.assistant .message-avatar {
    background: var(--bg-tertiary);
}

.message.user .message-avatar {
    background: var(--accent-gradient);
}

.message-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px 20px;
    border: 1px solid var(--border-color);
}

.message.user .message-content {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    border-color: rgba(34, 211, 238, 0.3);
}

.message-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
}

.message-text p {
    margin-bottom: 12px;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-text li {
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.message-text strong {
    color: var(--accent-primary);
}

/* Score Card */
.score-card {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    border: 1px solid var(--border-color);
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.score-name {
    font-size: 16px;
    font-weight: 600;
}

.score-value {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.score-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.score-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.breakdown-item span:last-child {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* Rankings */
.rankings {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.ranking-position {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.ranking-position.first {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
}

.ranking-position.second {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: #000;
}

.ranking-position.third {
    background: linear-gradient(135deg, #cd7c32 0%, #a05a2c 100%);
    color: #fff;
}

.ranking-position.other {
    background: var(--bg-primary);
    color: var(--text-muted);
}

.ranking-name {
    flex: 1;
    font-size: 14px;
}

.ranking-score {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent-primary);
}

/* Loading indicator */
.loading {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

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

/* Streaming Status */
.stream-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(34, 211, 238, 0.1);
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid rgba(34, 211, 238, 0.2);
}

.stream-status .loading {
    padding: 0;
}

.stream-status .loading-dot {
    width: 6px;
    height: 6px;
}

.status-text {
    font-size: 13px;
    color: var(--accent-primary);
    font-weight: 500;
}

/* Streaming Text */
.stream-text {
    min-height: 20px;
}

.stream-text:empty {
    display: none;
}

.streaming-para {
    position: relative;
}

.streaming-para::after {
    content: '▋';
    animation: blink 1s infinite;
    color: var(--accent-primary);
    font-weight: bold;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.intent-response {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 16px !important;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Score Cards Container */
.score-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.score-cards:empty {
    display: none;
}

/* Rankings Container */
.rankings-container:empty {
    display: none;
}

/* Animated Score Bar */
.score-bar-fill {
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Score Card Entrance Animation */
.score-card {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Chat Input
   ============================================ */

.chat-input-container {
    padding: 20px 32px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 8px 8px 8px 20px;
    transition: border-color 0.2s ease;
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--text-primary);
}

#messageInput::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.send-btn:hover {
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.send-icon {
    font-size: 18px;
    color: #000;
}

.input-hint {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .chat-input-container {
        padding: 16px;
    }
    
    .message {
        max-width: 95%;
    }
}

