/* ═══════════════════════════════════════════════════════
   YRIS LENS — Styles for Ray-Ban Display + Phone
   ═══════════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --amber: #FFB800;
    --amber-dim: #996F00;
    --white: #FFFFFF;
    --white-dim: #999999;
    --green: #00FF88;
    --red: #FF4444;
    --bg-transparent: transparent;
    --font-mono: 'Courier New', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: #000000;
    color: var(--white);
    font-family: var(--font-sans);
    width: 600px;
    height: 600px;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    /* Prevent text selection on glasses */
    user-select: none;
    -webkit-user-select: none;
}

.hidden { display: none !important; }

/* ── GLASSES VIEW ──────────────────────────────────── */
#glasses-view {
    width: 600px;
    height: 600px;
    display: flex;
    flex-direction: column;
    background: transparent;
    padding: 24px 20px;
}

.glasses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--amber-dim);
}

.logo {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: bold;
    color: var(--amber);
    letter-spacing: 2px;
}

.status {
    font-size: 10px;
    color: var(--green);
    animation: blink 2s infinite;
}
.status.disconnected { color: var(--red); animation: none; }

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

/* ── Main content area ─────────────────────────────── */
.glasses-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 16px 0;
}

/* Waiting state */
.center-message {
    text-align: center;
    opacity: 0.7;
}
.center-message p {
    font-size: 20px;
    margin-top: 16px;
    color: var(--white-dim);
}
.center-message .hint {
    font-size: 14px;
    color: var(--amber-dim);
    margin-top: 8px;
}

.pulse-ring {
    width: 60px;
    height: 60px;
    border: 2px solid var(--amber);
    border-radius: 50%;
    margin: 0 auto;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Answer state */
.question-badge {
    font-size: 12px;
    color: var(--amber-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding: 4px 10px;
    border: 1px solid var(--amber-dim);
    display: inline-block;
}

.answer-content {
    font-size: 18px;
    line-height: 1.6;
    color: var(--white);
    max-height: 420px;
    overflow-y: auto;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: border-color 0.15s;
}
.answer-content:focus,
.focusable:focus {
    outline: none;
    border-color: var(--amber) !important;
    box-shadow: 0 0 8px rgba(255, 184, 0, 0.3);
}
.answer-content ul { padding-left: 20px; margin: 8px 0; }
.answer-content li { margin: 4px 0; }
.answer-content strong { color: var(--amber); }
.answer-content code {
    background: rgba(255, 184, 0, 0.15);
    padding: 1px 4px;
    font-family: var(--font-mono);
    font-size: 15px;
}

/* ── Footer ────────────────────────────────────────── */
.glasses-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--amber-dim);
}

.key-hint {
    font-size: 11px;
    color: var(--white-dim);
    font-family: var(--font-mono);
}

/* ── History overlay ────────────────────────────────── */
#history-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
}

.history-header {
    font-size: 20px;
    color: var(--amber);
    font-family: var(--font-mono);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--amber-dim);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.history-item {
    padding: 10px 8px;
    margin-bottom: 8px;
    border: 1px solid transparent;
    border-left: 2px solid var(--amber-dim);
    cursor: default;
    transition: border-color 0.15s;
}
.history-item:focus {
    outline: none;
    border-color: var(--amber);
}
.history-item .hq {
    font-size: 12px;
    color: var(--amber-dim);
    margin-bottom: 4px;
}
.history-item .ha {
    font-size: 14px;
    color: var(--white-dim);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-footer {
    font-size: 12px;
    color: var(--white-dim);
    font-family: var(--font-mono);
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid var(--amber-dim);
}

/* ── PHONE VIEW ─────────────────────────────────────── */
#phone-view {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #0A0A0A;
    padding: 0;
}

.phone-container {
    width: 100%;
    max-width: 420px;
    padding: 24px 20px 40px;
}

.phone-header h1 {
    font-family: var(--font-mono);
    color: var(--amber);
    font-size: 28px;
    margin-bottom: 4px;
}
.phone-header .subtitle {
    color: var(--white-dim);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Last answer preview */
.last-answer {
    background: rgba(255, 184, 0, 0.08);
    border: 1px solid var(--amber-dim);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}
.last-answer .label {
    font-size: 11px;
    color: var(--amber-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.last-answer p {
    font-size: 15px;
    margin-top: 6px;
    color: var(--white-dim);
}

/* Input area */
.input-area {
    margin-bottom: 20px;
}

#question-input {
    width: 100%;
    background: #1A1A1A;
    border: 1px solid #333;
    border-radius: 10px;
    color: var(--white);
    font-size: 16px;
    padding: 14px;
    font-family: var(--font-sans);
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}
#question-input:focus {
    border-color: var(--amber);
}

.button-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-voice {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid #333;
    background: #1A1A1A;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-voice:hover { border-color: var(--amber); }
.btn-voice.listening {
    background: var(--red);
    border-color: var(--red);
    animation: pulse-btn 1s infinite;
}
@keyframes pulse-btn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(255, 68, 68, 0); }
}

.btn-send {
    flex: 1;
    height: 50px;
    border: none;
    border-radius: 10px;
    background: var(--amber);
    color: #000;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-send:hover { opacity: 0.85; }
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; }

.voice-status {
    font-size: 12px;
    color: var(--white-dim);
    margin-top: 8px;
    text-align: center;
    min-height: 18px;
}

/* Quick questions */
.quick-questions {
    margin-bottom: 24px;
}
.quick-questions .label {
    font-size: 11px;
    color: var(--white-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}
.quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.quick-btn {
    background: #1A1A1A;
    border: 1px solid #333;
    border-radius: 8px;
    color: var(--white);
    font-size: 13px;
    padding: 12px 10px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-sans);
}
.quick-btn:hover, .quick-btn:active {
    border-color: var(--amber);
    background: rgba(255, 184, 0, 0.1);
}

.session-info {
    text-align: center;
    font-size: 11px;
    color: #555;
}
.session-info code {
    font-family: var(--font-mono);
    background: #1A1A1A;
    padding: 2px 6px;
    border-radius: 3px;
}

/* ── Scoped to phone: override body dimensions ─────── */
@media (min-width: 601px) {
    body {
        width: 100%;
        height: 100%;
        min-height: 100vh;
    }
}

/* Scrollbar (glasses) */
.glasses-main::-webkit-scrollbar,
.history-list::-webkit-scrollbar,
.answer-content::-webkit-scrollbar {
    width: 3px;
}
.glasses-main::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb,
.answer-content::-webkit-scrollbar-thumb {
    background: var(--amber-dim);
    border-radius: 3px;
}