/* ========== SYMBIOTE — Cyberpunk Matrix Aesthetic ========== */

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

:root {
    /* Neon Colors */
    --neon-cyan: #00ffff;
    --neon-magenta: #ff00ff;
    --neon-purple: #9d4edd;
    --neon-green: #39ff14;
    --neon-red: #ff073a;

    /* Dark Matrix Background */
    --bg-deep: #050a14;
    --bg-darker: #0a1128;
    --bg-panel: rgba(10, 17, 40, 0.8);

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(0, 255, 255, 0.2);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #8892b0;
    --text-muted: #495670;
}

body {
    font-family: 'Courier New', 'Roboto Mono', monospace;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Animated Matrix Rain Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(to bottom, transparent 0%, var(--bg-deep) 100%),
        repeating-linear-gradient(90deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 255, 0.03) 2px,
            rgba(0, 255, 255, 0.03) 4px);
    z-index: -1;
    animation: matrix-scroll 20s linear infinite;
}

@keyframes matrix-scroll {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100vh;
    }
}

/* CRITICAL: Hidden/Visible Toggle */
.hidden {
    display: none !important;
}

/* ========== LOGIN MODAL ========== */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%,
            rgba(157, 78, 221, 0.1) 0%,
            transparent 50%);
    animation: pulse-glow 6s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.login-container {
    position: relative;
    width: 90%;
    max-width: 480px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    box-shadow:
        0 8px 32px rgba(0, 255, 255, 0.2),
        0 0 100px rgba(157, 78, 221, 0.3),
        inset 0 0 60px rgba(255, 255, 255, 0.02);
    animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.neon-glow {
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle,
            var(--neon-magenta) 0%,
            transparent 70%);
    filter: blur(80px);
    opacity: 0.5;
    animation: float 8s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translate(-50%, 0px);
    }

    50% {
        transform: translate(-50%, -30px);
    }
}

/* Glitch Effect */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--neon-cyan);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--neon-magenta);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(10px, 9999px, 100px, 0);
    }

    20% {
        clip: rect(80px, 9999px, 20px, 0);
    }

    40% {
        clip: rect(50px, 9999px, 90px, 0);
    }

    60% {
        clip: rect(30px, 9999px, 70px, 0);
    }

    80% {
        clip: rect(90px, 9999px, 40px, 0);
    }

    100% {
        clip: rect(60px, 9999px, 10px, 0);
    }
}

.login-title {
    font-size: 3rem;
    text-align: center;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: 8px;
    font-weight: bold;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 3px;
    margin-bottom: 2.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Buttons */
.btn {
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.btn-google {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-magenta));
    color: white;
    box-shadow: 0 4px 20px rgba(255, 0, 255, 0.4);
}

.btn-google:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 0, 255, 0.6);
}

.btn-icon {
    font-size: 1.5rem;
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 2px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            var(--glass-border),
            transparent);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-field {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.6);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-cyan), #00aaff);
    color: var(--bg-deep);
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 255, 255, 0.6);
}

.btn-secondary {
    background: transparent;
    color: var(--neon-cyan);
    border: 2px solid var(--neon-cyan);
}

.btn-secondary:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

/* Spinner */
.spinner-container {
    text-align: center;
    padding: 2rem 0;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 4px solid rgba(0, 255, 255, 0.2);
    border-top: 4px solid var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.spinner-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

/* ========== MAIN APP ========== */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.app-logo {
    font-size: 1.8rem;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    font-weight: bold;
}

.status-pulse {
    color: var(--neon-green);
    font-size: 0.9rem;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.user-email {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.psycho-profile {
    font-size: 0.75rem;
    color: var(--neon-magenta);
    letter-spacing: 1px;
}

.btn-logout {
    background: rgba(255, 7, 58, 0.15);
    border: 1px solid rgba(255, 7, 58, 0.4);
    color: var(--neon-red);
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.btn-logout:hover {
    background: rgba(255, 7, 58, 0.3);
    border-color: var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 7, 58, 0.4);
}

/* Stats Panel */
.stats-panel {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--glass-border);
}

.stat-card {
    flex: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.4rem;
    color: var(--neon-cyan);
    font-weight: bold;
    letter-spacing: 2px;
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chat-container::-webkit-scrollbar {
    width: 10px;
}

.chat-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--neon-purple);
    border-radius: 5px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: var(--neon-magenta);
}

/* Messages */
.message {
    padding: 1.2rem 1.8rem;
    border-radius: 14px;
    max-width: 75%;
    line-height: 1.6;
    animation: slideInMessage 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInMessage {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message.user {
    background: linear-gradient(135deg, var(--neon-cyan), #00aaff);
    color: var(--bg-deep);
    align-self: flex-end;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
}

.message.assistant {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    align-self: flex-start;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.message.system {
    background: rgba(157, 78, 221, 0.15);
    border: 1px solid rgba(157, 78, 221, 0.4);
    color: var(--neon-purple);
    align-self: center;
    font-size: 0.9rem;
    text-align: center;
    max-width: 60%;
}

/* Input Area */
.input-area {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.message-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.2rem 1.8rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.message-input:focus {
    outline: none;
    border-color: var(--neon-magenta);
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.3);
    background: rgba(0, 0, 0, 0.7);
}

.message-input::placeholder {
    color: var(--text-muted);
}

.btn-send {
    background: linear-gradient(135deg, var(--neon-magenta), var(--neon-purple));
    border: none;
    border-radius: 12px;
    padding: 1.2rem 3rem;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(255, 0, 255, 0.4);
    letter-spacing: 2px;
}

.btn-send:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 0, 255, 0.6);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.send-icon {
    font-size: 1.3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .stats-panel {
        flex-direction: column;
        gap: 1rem;
    }

    .message {
        max-width: 90%;
    }

    .input-area {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-send {
        padding: 1rem 2rem;
    }

    .login-container {
        padding: 2rem 1.5rem;
    }

    .login-title {
        font-size: 2.2rem;
    }
}