* {
    box-sizing: border-box;
}

:root {
    --bg: #08090c;
    --panel: rgba(255, 255, 255, 0.055);
    --panel-hover: rgba(255, 255, 255, 0.075);
    --border: rgba(255, 255, 255, 0.10);

    --text: #f5f5f7;
    --muted: rgba(255, 255, 255, 0.45);

    --accent: #ffffff;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    margin: 0;

    background:
        radial-gradient(
            circle at 20% 10%,
            rgba(100, 80, 255, 0.16),
            transparent 35%
        ),
        radial-gradient(
            circle at 85% 80%,
            rgba(0, 180, 255, 0.10),
            transparent 35%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    overflow: hidden;
}


/* ================================
   APP
================================ */

.app-shell {
    height: 100vh;

    display: flex;
    flex-direction: column;

    padding: 12px;
}


/* ================================
   TOP BAR
================================ */

.topbar {
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 14px;

    background: var(--panel);

    border: 1px solid var(--border);
    border-radius: 16px;

    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);

    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: white;
    color: black;

    box-shadow:
        0 0 25px rgba(255, 255, 255, 0.15);
}

.brand-name {
    font-size: 14px;
    font-weight: 600;
}

.brand-subtitle {
    margin-top: 2px;

    font-size: 10px;

    color: var(--muted);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

button {
    font-family: inherit;
    border: 0;
    cursor: pointer;
}

.toolbar-btn {
    height: 32px;

    padding: 0 13px;

    color: rgba(255, 255, 255, 0.8);

    background: rgba(255, 255, 255, 0.07);

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;

    transition: 0.15s ease;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.13);
}

.icon-btn {
    width: 32px;
    height: 32px;

    color: var(--muted);

    background: transparent;

    border-radius: 9px;
}

.icon-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.07);
}


/* ================================
   WORKSPACE
================================ */

.workspace {
    flex: 1;

    min-height: 0;

    display: grid;

    grid-template-columns:
        210px
        minmax(400px, 1fr)
        360px;

    gap: 9px;

    margin-top: 9px;
    margin-bottom: 9px;
}

.panel {
    min-width: 0;
    min-height: 0;

    background: var(--panel);

    border: 1px solid var(--border);
    border-radius: 16px;

    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);

    overflow: hidden;
}


/* ================================
   FILE PANEL
================================ */

.files-panel {
    padding: 10px;
}

.panel-header {
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 6px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 600;

    letter-spacing: 1px;
}

.small-btn {
    width: 25px;
    height: 25px;

    color: var(--muted);

    background: rgba(255, 255, 255, 0.06);

    border-radius: 7px;

    font-size: 17px;
}

.small-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.12);
}

.file-list {
    display: flex;
    flex-direction: column;

    gap: 2px;
}

.file {
    height: 34px;

    display: flex;
    align-items: center;

    gap: 9px;

    padding: 0 9px;

    color: rgba(255, 255, 255, 0.55);

    border-radius: 8px;

    font-size: 12px;

    cursor: pointer;

    transition: 0.15s ease;
}

.file:hover {
    color: white;
    background: rgba(255, 255, 255, 0.055);
}

.file.active {
    color: white;

    background: rgba(255, 255, 255, 0.10);

    box-shadow:
        inset 0 0 0 1px
        rgba(255, 255, 255, 0.05);
}

.file-icon {
    width: 19px;
    height: 19px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 5px;

    font-size: 9px;
    font-weight: 700;
}

.file-icon.html {
    color: #ff8b5c;
    background: rgba(255, 120, 70, 0.12);
}

.file-icon.css {
    color: #5ca8ff;
    background: rgba(70, 140, 255, 0.12);
}

.file-icon.js {
    color: #ffe35c;
    background: rgba(255, 220, 60, 0.12);
}


/* ================================
   EDITOR
================================ */

.editor-panel {
    display: flex;
    flex-direction: column;
}

.editor-header {
    height: 43px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 10px;

    border-bottom: 1px solid var(--border);

    flex-shrink: 0;
}

.editor-tab {
    height: 100%;

    display: flex;
    align-items: center;

    gap: 8px;

    padding: 0 8px;

    font-size: 12px;
}

.tab-dot {
    width: 5px;
    height: 5px;

    margin-left: 2px;

    border-radius: 50%;

    background: transparent;
}

.editor-actions button {
    padding: 5px 9px;

    color: var(--muted);

    background: transparent;

    border-radius: 7px;

    font-size: 10px;
}

.editor-actions button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.07);
}

.editor-wrapper {
    flex: 1;

    min-height: 0;

    display: flex;

    background: rgba(0, 0, 0, 0.12);
}

.line-numbers {
    width: 45px;

    padding-top: 17px;

    color: rgba(255, 255, 255, 0.18);

    text-align: right;

    padding-right: 12px;

    font-family:
        "Cascadia Code",
        Consolas,
        monospace;

    font-size: 12px;

    line-height: 1.65;

    user-select: none;

    overflow: hidden;
}

#codeEditor {
    flex: 1;

    min-width: 0;
    min-height: 0;

    resize: none;

    outline: none;
    border: none;

    padding: 17px 18px 40px 8px;

    background: transparent;

    color: #e7e7ea;

    font-family:
        "Cascadia Code",
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 13px;

    line-height: 1.65;

    tab-size: 4;
}

#codeEditor::selection {
    background: rgba(120, 140, 255, 0.25);
}


/* ================================
   AI
================================ */

.ai-panel {
    display: flex;
    flex-direction: column;
}

.ai-header {
    height: 59px;

    display: flex;
    align-items: center;

    padding: 0 15px;

    border-bottom: 1px solid var(--border);

    flex-shrink: 0;
}

.ai-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-avatar {
    width: 31px;
    height: 31px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    color: black;
    background: white;

    box-shadow:
        0 0 20px rgba(255, 255, 255, 0.12);
}

.ai-title strong {
    display: block;

    font-size: 13px;
}

.ai-status {
    display: flex;
    align-items: center;

    gap: 5px;

    margin-top: 2px;

    color: var(--muted);

    font-size: 10px;
}

.ai-status span,
.status-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #62df91;

    box-shadow:
        0 0 8px rgba(98, 223, 145, 0.6);
}


/* ================================
   MESSAGES
================================ */

.messages {
    flex: 1;

    min-height: 0;

    overflow-y: auto;

    padding: 18px;
}

.welcome {
    margin-top: 50px;

    text-align: center;
}

.welcome-icon {
    width: 42px;
    height: 42px;

    margin: 0 auto 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    color: black;
    background: white;

    box-shadow:
        0 0 30px rgba(255, 255, 255, 0.12);
}

.welcome h2 {
    margin: 0;

    font-size: 17px;
    font-weight: 600;
}

.welcome p {
    max-width: 260px;

    margin: 8px auto 20px;

    color: var(--muted);

    font-size: 11px;

    line-height: 1.5;
}

.suggestions {
    display: flex;
    flex-direction: column;

    gap: 6px;
}

.suggestions button {
    padding: 9px 10px;

    text-align: left;

    color: rgba(255, 255, 255, 0.6);

    background: rgba(255, 255, 255, 0.045);

    border: 1px solid rgba(255, 255, 255, 0.07);

    border-radius: 9px;

    font-size: 11px;

    transition: 0.15s ease;
}

.suggestions button:hover {
    color: white;

    background: rgba(255, 255, 255, 0.09);
}


/* CHAT MESSAGES */

.message {
    display: flex;

    gap: 8px;

    margin-bottom: 15px;
}

.message.user {
    justify-content: flex-end;
}

.message .bubble {
    max-width: 275px;

    padding: 9px 11px;

    border-radius: 11px;

    font-size: 12px;

    line-height: 1.5;

    white-space: pre-wrap;
}

.message.ai .bubble {
    background: rgba(255, 255, 255, 0.06);

    border: 1px solid rgba(255, 255, 255, 0.07);
}

.message.user .bubble {
    background: rgba(255, 255, 255, 0.13);

    border: 1px solid rgba(255, 255, 255, 0.10);
}

.message .avatar {
    width: 22px;
    height: 22px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 7px;

    color: black;
    background: white;

    font-size: 10px;
}


/* ================================
   CHAT INPUT
================================ */

.chat-area {
    margin: 10px;

    padding: 8px;

    display: flex;
    align-items: flex-end;

    gap: 7px;

    background: rgba(0, 0, 0, 0.18);

    border: 1px solid rgba(255, 255, 255, 0.09);

    border-radius: 12px;
}

#prompt {
    flex: 1;

    min-width: 0;

    max-height: 130px;

    resize: none;

    outline: none;
    border: none;

    padding: 5px 5px;

    color: white;

    background: transparent;

    font-family: inherit;
    font-size: 12px;

    line-height: 1.5;
}

#prompt::placeholder {
    color: rgba(255, 255, 255, 0.30);
}

.send-btn {
    width: 30px;
    height: 30px;

    flex-shrink: 0;

    color: black;

    background: white;

    border-radius: 9px;

    font-size: 16px;

    transition: 0.15s ease;
}

.send-btn:hover {
    transform: scale(1.05);
}


/* ================================
   STATUS BAR
================================ */

.statusbar {
    height: 26px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 9px;

    color: rgba(255, 255, 255, 0.35);

    font-size: 9px;

    flex-shrink: 0;
}

.status-left,
.status-right {
    display: flex;
    align-items: center;

    gap: 9px;
}

.status-left {
    gap: 6px;
}


/* ================================
   SCROLLBARS
================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.10);

    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}


/* ================================
   RESPONSIVE
================================ */

@media (max-width: 950px) {

    .workspace {
        grid-template-columns:
            170px
            minmax(300px, 1fr)
            300px;
    }

}

@media (max-width: 750px) {

    .workspace {
        grid-template-columns: 1fr;
    }

    .files-panel {
        display: none;
    }

}
/* ================================
   AI CHANGE PROPOSAL
================================ */

.change-proposal {
    margin-top: 12px;
    padding: 12px;

    background: rgba(255, 255, 255, 0.055);

    border: 1px solid rgba(255, 255, 255, 0.10);

    border-radius: 12px;

    animation: changeIn 0.18s ease;
}

.change-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.change-header strong {
    font-size: 12px;
}

.change-subtitle {
    margin-top: 3px;

    color: var(--muted);

    font-size: 9px;
}

.close-change {
    width: 23px;
    height: 23px;

    color: var(--muted);

    background: transparent;

    border-radius: 6px;

    font-size: 16px;
}

.close-change:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.change-files {
    margin-top: 10px;

    display: flex;
    flex-direction: column;

    gap: 4px;
}

.change-file {
    padding: 7px 8px;

    color: rgba(255, 255, 255, 0.65);

    background: rgba(0, 0, 0, 0.15);

    border-radius: 7px;

    font-family: monospace;
    font-size: 10px;
}

.change-file span {
    color: #78e6a3;
}

.change-actions {
    display: flex;

    gap: 6px;

    margin-top: 10px;
}

.discard-btn,
.apply-btn {
    flex: 1;

    height: 30px;

    border-radius: 8px;

    font-size: 10px;
}

.discard-btn {
    color: rgba(255, 255, 255, 0.6);

    background: rgba(255, 255, 255, 0.06);
}

.discard-btn:hover {
    background: rgba(255, 255, 255, 0.10);
}

.apply-btn {
    color: #050505;

    background: white;

    font-weight: 600;
}

.apply-btn:hover {
    background: #eeeeee;
}

.undo-floating {
    position: fixed;

    right: 24px;
    bottom: 42px;

    z-index: 100;

    height: 32px;

    padding: 0 12px;

    color: white;

    background: rgba(30, 30, 35, 0.85);

    border: 1px solid rgba(255, 255, 255, 0.12);

    border-radius: 9px;

    backdrop-filter: blur(20px);

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3);

    font-size: 11px;

    animation: changeIn 0.18s ease;
}

.undo-floating:hover {
    background: rgba(50, 50, 55, 0.9);
}

@keyframes changeIn {

    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}