/* ============================================================
   Jarvis — Neon Orange AI Network theme
   ============================================================ */

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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #050810;
    color: #ffae5c;
}

/* ============================================================
   Animated AI network background
   ============================================================ */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 140, 40, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(255, 80, 20, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(255, 200, 80, 0.06) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 140, 40, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 140, 40, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* Floating network nodes */
.network-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* ============================================================
   Screen layout
   ============================================================ */

.screen {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.screen.active {
    display: flex;
}

/* ============================================================
   Login screen
   ============================================================ */

.login-box {
    background: rgba(15, 18, 28, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 140, 40, 0.3);
    border-radius: 24px;
    padding: 48px 56px;
    box-shadow:
        0 0 40px rgba(255, 140, 40, 0.2),
        0 0 80px rgba(255, 140, 40, 0.1);
    min-width: 380px;
}

.login-box h1 {
    font-size: 48px;
    font-weight: 200;
    letter-spacing: 12px;
    text-align: center;
    background: linear-gradient(180deg, #ffd080 0%, #ff8030 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 140, 40, 0.5);
    margin-bottom: 8px;
}

.login-box .subtitle {
    text-align: center;
    color: rgba(255, 174, 92, 0.6);
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 36px;
}

.login-box input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 140, 40, 0.3);
    border-radius: 12px;
    color: #ffae5c;
    font-size: 14px;
    font-family: monospace;
    letter-spacing: 1px;
    margin-bottom: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.login-box input:focus {
    border-color: rgba(255, 140, 40, 0.8);
    box-shadow: 0 0 20px rgba(255, 140, 40, 0.3);
}

.login-box button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(180deg, #ff9040 0%, #ff6010 100%);
    border: none;
    border-radius: 12px;
    color: #0a0808;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
}

.login-box button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(255, 140, 40, 0.5);
}

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

.error {
    color: #ff5040;
    text-align: center;
    margin-top: 16px;
    min-height: 18px;
    font-size: 13px;
}

/* ============================================================
   Chat screen layout
   ============================================================ */

#chat-screen {
    padding: 24px;
}

#chat-screen header {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 174, 92, 0.7);
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff8030;
    box-shadow: 0 0 12px #ff8030;
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.text-btn {
    background: transparent;
    border: 1px solid rgba(255, 140, 40, 0.3);
    color: rgba(255, 174, 92, 0.7);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
}

.text-btn:hover {
    border-color: rgba(255, 140, 40, 0.8);
    color: #ffae5c;
    box-shadow: 0 0 15px rgba(255, 140, 40, 0.3);
}

/* ============================================================
   Orb container
   ============================================================ */

.orb-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* The orb itself — placeholder for now, we'll redesign next step */
.orb {
    width: 280px;
    height: 280px;
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
}

.orb-core {
    position: absolute;
    inset: 30%;
    border-radius: 50%;
    background: radial-gradient(circle, #ffe080 0%, #ff8030 60%, #c04010 100%);
    box-shadow:
        0 0 40px rgba(255, 140, 40, 0.9),
        0 0 80px rgba(255, 140, 40, 0.6),
        0 0 120px rgba(255, 140, 40, 0.4);
    animation: orb-pulse 3s ease-in-out infinite;
}

@keyframes orb-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.orb-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 140, 40, 0.4);
    animation: orb-rotate 20s linear infinite;
}

.orb-ring-1 { inset: 5%;  animation-duration: 12s; }
.orb-ring-2 { inset: 15%; animation-duration: 18s; animation-direction: reverse; }
.orb-ring-3 { inset: 25%; animation-duration: 24s; }

@keyframes orb-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.orb-hint {
    margin-top: 32px;
    color: rgba(255, 174, 92, 0.6);
    font-size: 12px;
    letter-spacing: 4px;
    text-transform: uppercase;
    min-height: 18px;
    text-align: center;
}

/* Orb states */
.orb.recording .orb-core {
    background: radial-gradient(circle, #ffffff 0%, #ffe080 50%, #ff6010 100%);
    box-shadow:
        0 0 60px rgba(255, 200, 80, 1),
        0 0 120px rgba(255, 140, 40, 0.8);
    animation-duration: 0.8s;
}

.orb.thinking .orb-ring {
    animation-duration: 4s;
    border-color: rgba(255, 200, 80, 0.7);
}

.orb.speaking .orb-core {
    animation-duration: 1.2s;
}

.orb.speaking .orb-ring {
    border-color: rgba(255, 200, 80, 0.8);
}

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

.messages {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 700px;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.message {
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    max-width: 80%;
    line-height: 1.4;
    animation: message-fade-in 0.4s ease;
}

@keyframes message-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    align-self: flex-end;
    background: rgba(255, 140, 40, 0.15);
    border: 1px solid rgba(255, 140, 40, 0.3);
    color: #ffd080;
}

.message.assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 174, 92, 0.15);
    color: #ffae5c;
}

.message.thinking {
    align-self: flex-start;
    color: rgba(255, 174, 92, 0.4);
    font-style: italic;
}

/* ============================================================
   Text input area
   ============================================================ */

.input-area {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    display: flex;
    gap: 8px;
}

.input-area input {
    flex: 1;
    padding: 12px 18px;
    background: rgba(15, 18, 28, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 140, 40, 0.3);
    border-radius: 12px;
    color: #ffae5c;
    font-size: 14px;
    outline: none;
}

.input-area input:focus {
    border-color: rgba(255, 140, 40, 0.8);
    box-shadow: 0 0 20px rgba(255, 140, 40, 0.3);
}

.input-area button {
    padding: 12px 24px;
    background: linear-gradient(180deg, #ff9040 0%, #ff6010 100%);
    border: none;
    border-radius: 12px;
    color: #0a0808;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
}

.input-area button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(255, 140, 40, 0.5);
}

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

/* ============================================================
   Login transition — "sucked into the orb"
   ============================================================ */

.screen.zoom-out .login-box {
    animation: suck-in 0.9s cubic-bezier(0.5, 0, 0.75, 0) forwards;
}

@keyframes suck-in {
    0%   { transform: scale(1)    rotate(0deg);   opacity: 1; }
    60%  { transform: scale(0.4)  rotate(180deg); opacity: 0.7; }
    100% { transform: scale(0)    rotate(720deg); opacity: 0; }
}

.screen.zoom-out {
    animation: bg-darken 0.9s ease-in forwards;
}

@keyframes bg-darken {
    from { background: transparent; }
    to { background: #000; }
}

.screen.zoom-in {
    animation: zoom-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes zoom-in {
    0%   { opacity: 0; transform: scale(0.3); filter: blur(20px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* ============================================================
   Hide messages and input — orb only mode
   ============================================================ */

.messages,
.input-area {
    display: none !important;
}
/* ============================================================
   Override old orb styles for canvas version
   ============================================================ */

.orb {
    width: 400px;
    height: 400px;
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orb-core,
.orb-ring {
    display: none;
}

#orb-canvas {
    width: 400px;
    height: 400px;
    filter: drop-shadow(0 0 30px rgba(255, 140, 40, 0.6));
}
/* Hide the orb hint text */
.orb-hint {
    display: none !important;
}

