:root {
    --neon: #00f2ff;
    --bg: #0a0a12;
    --glass: rgba(255, 255, 255, 0.1);
}

body {
    margin: 0;
    background: var(--bg);
    color: white;
    font-family: 'Segoe UI', sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* --- LOGIN SCREEN --- */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #161625 0%, #0a0a12 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.login-box {
    background: rgba(22, 22, 37, 0.8);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--neon);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
    text-align: center;
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease-out;
}

.login-box h2 {
    color: var(--neon);
    font-size: 2rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px var(--neon);
}

.login-box p {
    color: #aaa;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 8px;
    color: white;
    outline: none;
    font-size: 1rem;
    transition: border 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.input-group input:focus {
    border-color: var(--neon);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
}

#login-btn {
    width: 100%;
    padding: 12px;
    background: var(--neon);
    border: none;
    border-radius: 8px;
    color: #0a0a12;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#login-btn:hover {
    box-shadow: 0 0 15px var(--neon);
    filter: brightness(1.1);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(10, 10, 18, 0.3);
    border-top: 2px solid #0a0a12;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error-msg {

    color: #ff4d4d;
    font-size: 0.8rem;
    margin-top: 15px;
    height: 1rem;
}

/* --- DENIED MODAL --- */
.denied-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.denied-box {
    position: relative;
    background: #1a0a0a;
    padding: 60px 40px;
    border-radius: 20px;
    border: 2px solid #ff0033;
    box-shadow: 0 0 30px rgba(255, 0, 51, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    overflow: hidden;
}

.denied-text {
    color: #ff0033;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
    text-shadow: 0 0 15px #ff0033;
    letter-spacing: 4px;
}

.denied-subtext {
    color: #ffaaaa;
    font-size: 1rem;
    margin: 20px 0 40px 0;
    font-family: 'Courier New', Courier, monospace;
}

.close-denied-btn {
    background: transparent;
    border: 1px solid #ff0033;
    color: #ff0033;
    padding: 10px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.close-denied-btn:hover {
    background: #ff0033;
    color: white;
    box-shadow: 0 0 15px #ff0033;
}

.laser-scanner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #ff0033;
    box-shadow: 0 0 15px #ff0033, 0 0 30px #ff0033;
    z-index: 1;
    animation: scan 2s linear infinite alternate;
}

@keyframes scan {
    from {
        top: 0%;
    }

    to {
        top: 100%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- MAIN CONTENT --- */
.main-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

#header-area {
    padding: 15px 20px;
    border-radius: 0 0 20px 20px;
    background: #161625;
    border-bottom: 1px solid var(--neon);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

#header-area h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--neon);
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

#new-chat-btn {
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid var(--neon);
    color: var(--neon);
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: all 0.3s;
}

#new-chat-btn:hover {
    background: var(--neon);
    color: #0a0a12;
    box-shadow: 0 0 10px var(--neon);
}

#logout-btn {
    background: transparent;
    border: 1px solid var(--neon);
    color: var(--neon);
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: all 0.3s;
}

#logout-btn:hover {
    /* background: var(--neon); */
    background: red;
    color: #fff;
}

#ia-selector {
    background: var(--bg);
    color: var(--neon);
    border: 1px solid var(--neon);
    padding: 10px;
    border-radius: 8px;
    outline: none;
    font-family: 'Segoe UI', sans-serif;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
}

#ia-selector option {
    background: var(--bg);
    color: white;
}

#chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#chat-container::-webkit-scrollbar {
    width: 6px;
}

#chat-container::-webkit-scrollbar-track {
    background: var(--bg);
}

#chat-container::-webkit-scrollbar-thumb {
    background: var(--neon);
    border-radius: 10px;
    box-shadow: 0 0 10px var(--neon);
}

#chat-container::-webkit-scrollbar-thumb:hover {
    background: #00d1df;
}

.message {
    padding: 15px;
    border-radius: 15px;
    max-width: 80%;
    backdrop-filter: blur(10px);
    animation: appear 0.3s ease;
}

.message.user {
    align-self: flex-end;
    background: rgba(0, 242, 255, 0.15);
    border: 1px solid var(--neon);
    color: white;
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
    border-bottom-right-radius: 2px;
}

.message.ai {
    align-self: flex-start;
    background: rgba(115, 139, 243, 0.1);
    border: 1px solid rgba(0, 68, 255, 0.5);
    color: #d1d1ff;
    border-bottom-left-radius: 2px;
    box-shadow: 0 0 10px rgba(7, 109, 156, 0.15);
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
    }
}

.loading-message {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: rgba(0, 242, 255, 0.05);
    max-width: fit-content;
    width: auto;
    padding: 10px 15px;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 5px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--neon);
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
    box-shadow: 0 0 8px var(--neon);
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

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

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

input:disabled,
textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    border-color: #444 !important;
    background-color: #222 !important;
}

button:disabled {
    background: #444 !important;
    color: #888 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    border-color: #444 !important;
    filter: grayscale(1);
}

#input-area {
    padding: 15px 20px 5px 20px;
    border-radius: 20px 20px 0 0;
    background: #161625;
    display: flex;
    border-top: 1px solid var(--neon);
    flex-direction: column;
    gap: 10px;
}

.input-controls {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.button-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

#attach-btn {
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid var(--neon);
    color: var(--neon);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

#attach-btn:hover {
    background: var(--neon);
    color: #0a0a12;
    box-shadow: 0 0 15px var(--neon);
}

.attachment-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.attachment-item {
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid var(--neon);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    animation: appear 0.2s ease;
}

.remove-attachment {
    cursor: pointer;
    color: #ff4d4d;
    font-weight: bold;
    font-size: 1rem;
    line-height: 1;
}

.remove-attachment:hover {
    color: #ff0000;
}

textarea {
    flex: 1;
    background: transparent;
    border: 1px solid var(--neon);
    padding: 12px;
    color: white;
    border-radius: 10px;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    max-height: 150px;
}

#send-btn {
    background: var(--neon);
    border: none;
    padding: 8px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
    white-space: nowrap;
    width: fit-content;
}

#send-btn:hover {
    box-shadow: 0 0 15px var(--neon);
    filter: brightness(1.1);
}

#send-btn:active {
    transform: scale(0.92);
    box-shadow: 0 0 5px var(--neon);
    filter: brightness(0.9);
}

button {
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

button:active {
    transform: scale(0.92);
    box-shadow: 0 0 5px var(--neon);
    filter: brightness(0.9);
}

#ia-selector {
    background: var(--bg);
    color: var(--neon);
    border: 1px solid var(--neon);
    padding: 6px 10px;
    border-radius: 8px;
    outline: none;
    font-family: 'Segoe UI', sans-serif;
    font-weight: bold;
    cursor: pointer;
    width: fit-content;
    margin: 0 auto;
    font-size: 0.85rem;
}

#main-footer {
    background: #0f0f1a;
    border-top: 1px solid var(--neon);
    padding: 15px 0;
    color: #888;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.glow-text {
    color: var(--neon);
    text-shadow: 0 0 10px var(--neon);
    font-weight: bold;
}

.separator {
    color: #444;
}

.dev-name {
    color: #ccc;
}

.dev-name strong {
    color: white;
}

.footer-tech {
    display: flex;
    gap: 15px;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .main-wrapper {
        width: 100%;
        max-width: 100%;
    }

    #header-area {
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
        text-align: center;
        box-sizing: border-box;
    }

    .message {
        max-width: 90%;
    }

    #input-area {
        padding: 10px;
        gap: 8px;
    }

    .input-controls {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    textarea {
        font-size: 14px;
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .button-group {
        justify-content: center;
        width: 100%;
    }

    #send-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        width: 150px;
        flex-shrink: 0;
    }

    #ia-selector {
        font-size: 0.75rem;
        padding: 4px 8px;
        max-width: 90%;
    }

    .footer-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }

    .footer-tech {
        font-size: 0.7rem;
        justify-content: center;
    }
}