/* jarvis.css - J.A.R.V.I.S. High-Tech UI System */
:root {
    --jarvis-blue: #00d2ff;
    --jarvis-glow: rgba(0, 210, 255, 0.4);
    --jarvis-bg: rgba(5, 11, 20, 0.85);
    --jarvis-edge: rgba(255, 255, 255, 0.1);
}

#jarvis-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 2000001;
    /* Above EVERYTHING */
    font-family: 'Montserrat', sans-serif;
    pointer-events: none;
}

.jarvis-trigger {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--jarvis-bg);
    pointer-events: auto;
    border: 1px solid var(--jarvis-edge);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.jarvis-trigger:hover {
    transform: scale(1.1);
    border-color: var(--jarvis-blue);
    box-shadow: 0 0 30px var(--jarvis-glow);
}

.jarvis-ring {
    position: absolute;
    inset: -5px;
    border: 1px dashed var(--jarvis-blue);
    border-radius: 50%;
    opacity: 0.3;
    animation: jarvis-spin 10s linear infinite;
}

.jarvis-core {
    width: 20px;
    height: 20px;
    background: var(--jarvis-blue);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--jarvis-blue), 0 0 30px var(--jarvis-blue);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jarvis-core::after {
    content: "";
    position: absolute;
    inset: -8px;
    border: 2px solid var(--jarvis-blue);
    border-radius: 50%;
    animation: jarvis-pulse 2s ease-out infinite;
}

/* Chat Panel */
.jarvis-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    max-height: 500px;
    background: var(--jarvis-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--jarvis-edge);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.jarvis-panel.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

.jarvis-header {
    padding: 20px;
    border-bottom: 1px solid var(--jarvis-edge);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 210, 255, 0.05);
}

.jarvis-header h3 {
    margin: 0;
    font-size: 0.9rem;
    letter-spacing: 3px;
    color: var(--jarvis-blue);
    text-transform: uppercase;
    font-weight: 600;
}

.jarvis-status {
    font-size: 0.6rem;
    color: #a0b0c8;
    letter-spacing: 1px;
}

.jarvis-header-link,
.jarvis-close-panel {
    background: transparent;
    border: 1px solid var(--jarvis-edge);
    color: var(--jarvis-blue);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.8rem;
}

.jarvis-header-link:hover,
.jarvis-close-panel:hover {
    background: var(--jarvis-blue);
    color: #000;
}

.jarvis-content {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 300px;
    scrollbar-width: thin;
    scrollbar-color: var(--jarvis-blue) transparent;
    z-index: 2;
}

/* --- PHOTOGRAPHY BOKEH BACKGROUND --- */
.jarvis-bokeh-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(0, 150, 255, 0.03) 0%, transparent 70%);
}

.bokeh-particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.8) 0%, rgba(0, 210, 255, 0) 70%);
    filter: blur(4px);
    opacity: 0.15;
    animation: float-bokeh 12s infinite ease-in-out alternate;
}

.bokeh-particle.b1 {
    width: 40px;
    height: 40px;
    top: 10%;
    left: 10%;
    animation-duration: 15s;
}

.bokeh-particle.b2 {
    width: 70px;
    height: 70px;
    top: 50%;
    left: 80%;
    animation-duration: 22s;
    filter: blur(6px);
    opacity: 0.1;
}

.bokeh-particle.b3 {
    width: 20px;
    height: 20px;
    top: 80%;
    left: 30%;
    animation-duration: 10s;
}

.bokeh-particle.b4 {
    width: 50px;
    height: 50px;
    top: 30%;
    left: 60%;
    animation-duration: 18s;
    filter: blur(5px);
    opacity: 0.08;
}

.bokeh-particle.b5 {
    width: 30px;
    height: 30px;
    top: 70%;
    left: 70%;
    animation-duration: 14s;
    filter: blur(3px);
}

@keyframes float-bokeh {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        transform: translateY(-40px) translateX(20px) scale(1.2);
        opacity: 0.1;
    }
}

.jarvis-message {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 85%;
    position: relative;
    z-index: 2;
    animation: jarvis-fade-in 0.3s ease forwards;
}

.jarvis-message.ai {
    background: rgba(255, 255, 255, 0.05);
    color: #eee;
    align-self: flex-start;
    border-left: 2px solid var(--jarvis-blue);
}

.jarvis-message.user {
    background: var(--jarvis-blue);
    color: #000;
    align-self: flex-end;
    font-weight: 500;
}

.jarvis-input-area {
    padding: 20px;
    border-top: 1px solid var(--jarvis-edge);
    display: flex;
    gap: 10px;
    align-items: center;
}

.jarvis-input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--jarvis-edge);
    border-radius: 30px;
    padding: 10px 18px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.3s ease;
}

.jarvis-input:focus {
    border-color: var(--jarvis-blue);
    background: rgba(255, 255, 255, 0.1);
}

.jarvis-voice-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--jarvis-edge);
    color: #a0b0c8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.jarvis-voice-btn.active {
    color: var(--jarvis-blue);
    border-color: var(--jarvis-blue);
    box-shadow: 0 0 15px var(--jarvis-glow);
    animation: jarvis-beat 1s infinite alternate;
}

/* Animations */
@keyframes jarvis-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes jarvis-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

@keyframes jarvis-beat {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

@keyframes jarvis-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hologram Effect */
.hologram-text {
    text-shadow: 0 0 5px var(--jarvis-blue), 0 0 10px var(--jarvis-blue);
    font-family: 'Courier New', Courier, monospace;
}

.scanline {
    width: 100%;
    height: 2px;
    background: rgba(0, 210, 255, 0.1);
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    animation: scanline 4s linear infinite;
}

@keyframes scanline {
    0% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

@media (max-width: 1024px) {
    #jarvis-container {
        bottom: calc(102px + env(safe-area-inset-bottom, 0px));
        right: 14px;
    }

    .jarvis-panel {
        width: min(340px, calc(100vw - 24px));
        bottom: 70px;
        right: 0;
        max-height: min(66vh, 520px);
    }
}

@media (max-width: 768px) {
    .jarvis-panel {
        width: min(300px, calc(100vw - 24px));
    }
}

@media (max-width: 520px) {
    #jarvis-container {
        right: 10px;
    }

    .jarvis-panel {
        width: calc(100vw - 20px);
    }
}