/* components.css — Context menus, modals, auth pages */

/* Context menu */
.context-menu {
    position: fixed;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 4px;
    min-width: 160px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    animation: ctxIn 0.12s ease-out;
}

@keyframes ctxIn {
    from { opacity: 0; transform: scale(0.95) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.context-item {
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-primary);
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-item:hover {
    background: var(--accent-dim);
}

.context-item.danger {
    color: var(--danger);
}

.context-item.danger:hover {
    background: var(--danger-dim);
}

/* Move submenu */
.context-submenu {
    padding: 4px 8px 6px;
}

.context-submenu select {
    width: 100%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 5px 8px;
    font-size: 0.78rem;
    font-family: var(--font-sans);
    outline: none;
    cursor: pointer;
}

/* Auth pages */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
    padding: 20px;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.auth-card .form-group { margin-bottom: 16px; }

.auth-card label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-card input {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition-normal);
}

.auth-card input:focus { border-color: var(--accent); }

.auth-card button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    margin-top: 8px;
    transition: background var(--transition-normal);
}

.auth-card button[type="submit"]:hover { background: var(--accent-hover); }

.auth-card .error {
    background: var(--danger-dim);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.auth-eye-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

/* === JIMMY EYE === */
.jimmy-eye-svg .eye-group {
    transition: transform 0.11s ease-in-out;
    transform-origin: 28px 28px;
}

.jimmy-eye-svg .eye-group.blink {
    transform: scaleY(0.05);
}

/* Thinking: pupil wanders */
.jimmy-eye-svg.eye-thinking .eye-pupil {
    animation: pupilWander 3s ease-in-out infinite;
}

.jimmy-eye-svg.eye-thinking .eye-iris {
    animation: pupilWander 3s ease-in-out infinite;
}

/* Responding: glow pulse */
.jimmy-eye-svg.eye-responding .eye-glow {
    animation: glowPulse 1.5s ease-in-out infinite;
    opacity: 1;
}

.jimmy-eye-svg.eye-responding .eye-pupil {
    r: 4.5;
    transition: r 0.3s ease;
}

.jimmy-eye-svg.eye-responding .eye-iris {
    r: 8;
    transition: r 0.3s ease;
}

/* Listening: looks down */
.jimmy-eye-svg.eye-listening .eye-pupil {
    cy: 33;
    cx: 28;
    transition: cy 0.3s ease, cx 0.3s ease;
}

.jimmy-eye-svg.eye-listening .eye-iris {
    cy: 32;
    cx: 28;
    transition: cy 0.3s ease, cx 0.3s ease;
}

/* Error: red flash */
.jimmy-eye-svg.eye-error .eye-iris {
    fill: #ef4444;
    r: 9;
    transition: all 0.1s;
}

.jimmy-eye-svg.eye-error .eye-pupil {
    r: 1.5;
    fill: #450a0a;
    transition: all 0.1s;
}

@keyframes pupilWander {
    0%   { cx: 28; cy: 28; }
    12%  { cx: 33; cy: 24; }
    28%  { cx: 23; cy: 26; }
    45%  { cx: 34; cy: 30; }
    62%  { cx: 22; cy: 25; }
    78%  { cx: 31; cy: 32; }
    100% { cx: 28; cy: 28; }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.2; }
    50%      { opacity: 0.8; }
}