@import "tailwindcss";
@source "*.html";

html {
    scroll-behavior: smooth;
}

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

:root {
    --surface: #1f1f21;
    --surface-high: #2a2a2c;
    --surface-highest: #353437;
    --surface-lowest: #0e0e10;
    --on-surface: #e4e2e4;
    --on-surface-variant: #c7c6ca;
    --outline: #919094;
    --outline-variant: #46464a;
    --tertiary: #00dbe9;
    --on-tertiary: #002022;
    --error: #ef4444;
    --background: #131315;
}

/* ============================================
   Material Icons
   ============================================ */

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* ============================================
   Glass Panel Component
   ============================================ */

.glass-panel {
    background: rgba(26, 26, 28, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--outline-variant);
}

/* ============================================
   Sonic Glow Effect
   ============================================ */

.sonic-glow {
    box-shadow: 0 0 16px rgba(0, 219, 233, 0.3);
}

/* ============================================
   Recessed Button
   ============================================ */

.recessed-button {
    background: linear-gradient(to bottom, #2A2A2C, #1A1A1C);
    border: 1px solid #444446;
}

.recessed-button:active {
    transform: scale(0.98);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Tab Navigation
   ============================================ */

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

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

/* ============================================
   LED Status Indicators
   ============================================ */

.led-segment {
    width: 4px;
    height: 12px;
    background: #454747;
    margin-right: 2px;
}

.led-segment.active {
    background: #00dbe9;
    box-shadow: 0 0 4px #00dbe9;
}

.led-segment.warning {
    background: #ffb4ab;
}

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

.chat-messages {
    scrollbar-width: thin;
    scrollbar-color: #46464a #1f1f21;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1f1f21;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #46464a;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #00dbe9;
}

/* ============================================
   Message Bubbles
   ============================================ */

.message {
    display: flex;
    max-width: 100%;
    animation: fadeIn 0.3s ease;
    margin-bottom: 1rem;
}

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

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

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

.message-content {
    background: var(--surface-high);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--outline-variant);
    max-width: 70%;
}

.bot-message .message-content p {
    font-size: 0.9375rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #f6d84a;
    text-align: left;
}

.user-message .message-content p {
    font-size: 0.9375rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--on-surface);
    text-align: right;
}

.user-message .message-content {
    background: var(--surface-highest);
}

.message-content p.error {
    color: var(--error);
}

/* ============================================
   Thinking Indicator
   ============================================ */

.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface-high);
    border-radius: 0.5rem;
    width: fit-content;
    margin-bottom: 1rem;
    border: 1px solid var(--outline-variant);
}

.thinking-indicator span {
    color: var(--tertiary);
    font-style: italic;
}

/* ============================================
   Send Button
   ============================================ */

.send-button {
    background: var(--tertiary);
    color: var(--on-tertiary);
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    align-self: flex-end;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    filter: brightness(1.1);
    box-shadow: 0 0 12px rgba(0, 219, 233, 0.4);
}

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

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

#chat-input {
    background: var(--surface);
    border: 1px solid var(--outline-variant);
    border-radius: 0.125rem;
    padding: 0.75rem 1rem;
    color: var(--on-surface);
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease, height 0.1s ease;
    line-height: 1.5;
    height: 48px;
    max-height: 240px;
    overflow-y: hidden;
    resize: none;
    width: 100%;
    box-sizing: border-box;
}

#chat-input:focus {
    border-color: var(--tertiary);
}

#chat-form {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: flex-end;
}

#chat-input::placeholder {
    color: var(--on-surface-variant);
}

#chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Prose Styles (Documentation)
   ============================================ */

#doc-content {
    color: var(--on-surface-variant);
    font-size: 16px;
    line-height: 1.6;
}

#doc-content h1 {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 36px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--on-surface);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--outline-variant);
}

#doc-content h2 {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 28px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--on-surface);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

#doc-content h3 {
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 22px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--tertiary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

#doc-content p {
    margin-bottom: 1rem;
    color: var(--on-surface-variant);
}

#doc-content ul, #doc-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--on-surface-variant);
}

#doc-content li {
    margin-bottom: 0.5rem;
}

#doc-content a {
    color: var(--tertiary);
    text-decoration: none;
}

#doc-content a:hover {
    text-decoration: underline;
}

#doc-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    background: var(--surface-high);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    color: var(--tertiary);
}

#doc-content pre {
    background: var(--surface-high);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--outline-variant);
}

#doc-content pre code {
    background: none;
    padding: 0;
    color: var(--on-surface);
}

#doc-content blockquote {
    border-left: 4px solid var(--tertiary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--on-surface-variant);
    font-style: italic;
}

#doc-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

#doc-content th, #doc-content td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--outline-variant);
}

#doc-content th {
    background: var(--surface-high);
    color: var(--on-surface);
    font-weight: 600;
}

#doc-content tr:nth-child(even) {
    background: rgba(42, 42, 44, 0.3);
}

#doc-content hr {
    border: none;
    border-top: 1px solid var(--outline-variant);
    margin: 2rem 0;
}

/* ============================================
   Utility Classes
   ============================================ */

.opacity-60 {
    opacity: 0.6;
}

.text-2xl {
    font-size: 1.5rem;
}

/* ============================================
   Issue Cards
   ============================================ */

.issue-card {
    transition: all 0.2s ease;
}

.issue-card:hover {
    border-color: var(--tertiary);
}

.issue-header:hover {
    background: rgba(42, 42, 44, 0.3);
}

.expand-btn {
    transition: transform 0.2s ease;
}

.issue-label {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
}

.issue-details {
    background: rgba(31, 31, 33, 0.5);
}

.test-input,
.test-textarea {
    background: var(--surface-high);
    border: 1px solid var(--outline-variant);
    border-radius: 0.125rem;
    padding: 0.5rem 0.75rem;
    color: var(--on-surface);
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease;
}

.test-input:focus,
.test-textarea:focus {
    border-color: var(--tertiary);
}

.test-textarea {
    resize: none;
    line-height: 1.5;
}

.test-radio {
    accent-color: var(--tertiary);
    width: 16px;
    height: 16px;
}

.test-submit-btn {
    background: var(--tertiary);
    color: var(--on-tertiary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.125rem;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.test-submit-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 12px rgba(0, 219, 233, 0.4);
}

.submitting-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--surface-high);
    border-top-color: var(--tertiary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.test-confirmation {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.retry-btn {
    background: transparent;
    border: 1px solid var(--error);
    color: var(--error);
    padding: 0.375rem 0.75rem;
    border-radius: 0.125rem;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: var(--error);
    color: var(--on-error);
}

.submit-error {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.text-error {
    color: var(--error);
}
