/* --- CSS Reset & Variables --- */
:root {
    /* Color Palette - Premium Dark Theme */
    --bg-base: #0d1117; /* GitHub Dark Base */
    --bg-surface: #161b22; /* Lighter surface */
    --bg-sidebar: #0d1117;
    --bg-activity: #0d1117;
    
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    
    --accent: #2f81f7;
    --accent-hover: #388bfd;
    --accent-glow: rgba(47, 129, 247, 0.4);
    
    --border: #30363d;
    --border-light: #21262d;
    
    --font-ui: 'Inter', system-ui, sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 12px;
}

[data-theme="darker"] {
    --bg-base: #090c10;
    --bg-surface: #0d1117;
    --bg-sidebar: #090c10;
    --bg-activity: #05080c;
    --border: #21262d;
    --border-light: #161b22;
}

[data-theme="midnight"] {
    --bg-base: #061020;
    --bg-surface: #0a1628;
    --bg-sidebar: #061020;
    --bg-activity: #040b17;
    --border: #1a2f4c;
    --border-light: #0d1a2f;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
}

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

body {
    font-family: var(--font-ui);
    background-color: var(--bg-base);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    font-size: 13px; /* Ukuran font dikecilkan */
    display: flex;
    flex-direction: column;
}

/* Hide scrollbar globally */
* {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

textarea::-webkit-scrollbar {
    display: none !important;
}

/* --- Titlebar Drag Region --- */
.titlebar {
    height: 35px;
    background-color: var(--bg-base);
    -webkit-app-region: drag;
    -webkit-user-select: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 12px;
    color: var(--text-main);
}

.titlebar-logo {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.titlebar-logo img {
    height: 18px;
}

.titlebar-menu {
    display: flex;
    gap: 2px;
    -webkit-app-region: no-drag;
}

.titlebar-menu span {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
}

.titlebar-menu span:hover {
    background-color: var(--bg-surface);
}

/* --- Titlebar Actions (Account) --- */
.titlebar-actions {
    margin-left: auto;
    margin-right: 140px; /* Space for native window controls */
    display: flex;
    align-items: center;
    position: relative;
    -webkit-app-region: no-drag;
}

.account-menu {
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.account-menu i {
    font-size: 18px;
}

.account-menu:hover {
    color: var(--text-main);
    background-color: var(--bg-surface);
}

.account-dropdown {
    position: absolute;
    top: 32px;
    right: 0;
    width: 210px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    display: none;
    z-index: 9999;
    flex-direction: column;
}

.account-dropdown.show {
    display: flex;
}

.account-dropdown .dropdown-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-dropdown .folder-item {
    padding: 4px 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.account-dropdown .dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    font-size: 13px;
    transition: background-color 0.2s;
}

.account-dropdown .dropdown-item:hover {
    background-color: var(--accent);
    color: white;
}

.titlebar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--text-muted);
}

/* --- Layout Structure --- */
.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* --- Resizer --- */
.resizer {
    width: 3px;
    background-color: var(--border);
    cursor: col-resize;
    flex-shrink: 0;
    transition: background-color 0.2s;
    z-index: 10;
}
.resizer:hover, .resizer.resizing {
    background-color: var(--accent);
}

/* --- Activity Bar (Leftmost Sidebar) --- */
.activity-bar {
    width: 48px;
    background-color: var(--bg-activity);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 0;
    z-index: 10;
}

.top-actions, .bottom-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.icon-btn:hover {
    color: var(--text-main);
}

.icon-btn.active {
    color: var(--accent);
}

.icon-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--accent);
}

/* --- Sidebar (Explorer) --- */
.sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 10px 15px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 35px;
    border-bottom: 1px solid var(--border);
}

.icon-btn-small {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}
.icon-btn-small:hover {
    color: var(--text-main);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
}

.inline-rename-input {
    background-color: var(--bg-base);
    border: 1px solid var(--accent);
    color: var(--text-main);
    padding: 2px 4px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    width: 100%;
    margin-right: 10px;
    border-radius: 2px;
    pointer-events: auto;
    user-select: text;
}

.folder-item, .file-item {
    display: flex;
    align-items: center;
    padding: 0 15px;
    height: 30px;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    white-space: nowrap;
}

.folder-item {
    font-weight: 500;
}

.file-item {
    /* Padding diurus oleh JS sekarang */
}

.indent-guide {
    width: 15px;
    align-self: stretch;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.folder-item i, .file-item i {
    margin-right: 6px;
    font-size: 16px;
}

.file-item:hover, .folder-item:hover {
    background-color: var(--bg-surface);
    color: var(--text-main);
}

.file-item.active {
    background-color: var(--border-light);
    color: var(--accent);
}

/* --- Editor Area (Tengah) --- */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-base);
    border-right: 1px solid var(--border);
    min-width: 0;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    height: 35px;
}

.editor-tabs {
    display: flex;
    overflow-x: auto;
    flex: 1;
}

.editor-actions {
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-left: 1px solid var(--border);
}

.action-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 400;
}
.action-btn:hover {
    background: var(--border-light);
    color: var(--text-main);
}
.action-btn:disabled {
    background: transparent;
    color: #484f58;
    cursor: not-allowed;
}

.code-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    background-color: var(--bg-base);
    height: 100%;
    min-height: 0; /* Mencegah flexbox memanjang mengikuti isi */
    overflow: hidden;
}

/* Custom styling untuk CodeMirror agar memenuhi area */
.CodeMirror {
    flex: 1;
    height: 100% !important;
    font-family: var(--font-mono) !important;
    font-size: 14px;
    background-color: var(--bg-base) !important;
}

#codeEditor {
    display: none;
}

/* --- AI Area (Kanan) --- */
.ai-area {
    width: 350px;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    min-height: 0;
}
.ai-area .editor-tabs {
    flex: none;
    height: 35px;
    border-bottom: 1px solid var(--border);
}

/* --- Tabs --- */

.tab {
    display: flex;
    align-items: center;
    padding: 0 15px;
    background-color: var(--bg-surface);
    color: var(--text-muted);
    border-right: 1px solid var(--border);
    border-top: 1px solid transparent;
    cursor: pointer;
    min-width: 150px;
    font-size: 13px;
    gap: 8px;
    height: 100%;
}

.tab i:first-child {
    font-size: 16px;
}

.tab.active {
    background-color: var(--bg-base);
    color: var(--text-main);
    border-top: 1px solid var(--accent);
}

.close-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    margin-left: 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-tab:hover {
    color: #f85149;
    background-color: rgba(248, 81, 73, 0.1);
}

/* --- Editor / Chat Content --- */
.editor-content {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Penting untuk mengizinkan overflow-y auto di child */
}

/* --- AI Chat Header with Actions --- */
.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 6px;
}

.ai-header-actions {
    display: flex;
    gap: 2px;
    margin-left: auto;
    -webkit-app-region: no-drag;
}

/* --- Chat History Slide Panel --- */
.chat-history-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #161b22;
    border-right: 1px solid #30363d;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-history-panel.open {
    transform: translateX(0);
}

.chat-history-backdrop {
    position: absolute;
    inset: 0;
    z-index: 199;
    background: rgba(0,0,0,0.3);
}
.chat-history-backdrop.hidden { display: none; }

.chp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #30363d;
    font-size: 12px;
    font-weight: 600;
    color: #c9d1d9;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.chp-close-btn {
    background: none;
    border: none;
    color: #6e7681;
    cursor: pointer;
    font-size: 14px;
    padding: 3px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.chp-close-btn:hover { color: #c9d1d9; }

.chp-new-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 10px 6px;
    padding: 9px 12px;
    background: rgba(47,129,247,0.1);
    border: 1px dashed rgba(47,129,247,0.4);
    border-radius: 8px;
    color: #58a6ff;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.chp-new-btn:hover {
    background: rgba(47,129,247,0.18);
    border-color: #2f81f7;
}

.chp-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px 12px;
}

.chp-loading {
    text-align: center;
    color: #6e7681;
    font-size: 12px;
    padding: 20px;
}

.chp-item {
    padding: 9px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12.5px;
    color: #8b949e;
    transition: all 0.15s;
    border: 1px solid transparent;
    margin-bottom: 2px;
}

.chp-item:hover {
    background: #21262d;
    color: #c9d1d9;
    border-color: #30363d;
}

.chp-item.active {
    background: #1f3a5a;
    color: #79c0ff;
    border-color: #388bfd;
}

.chp-item-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.chp-item-meta {
    font-size: 11px;
    color: #6e7681;
}

/* --- Chat Container --- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 0;
    scroll-behavior: smooth;
}

/* --- Message Rows (Antigravity-style flat, no card) --- */
.message {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 100%;
    padding: 10px 0;
    animation: fadeIn 0.25s ease;
    border-bottom: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* User message: right-aligned bubble like Antigravity */
.message.user-msg {
    align-items: flex-end;
}

.message.user-msg .msg-content {
    background-color: #1c2128;
    border: 1px solid #30363d;
    border-radius: 18px 18px 4px 18px;
    padding: 10px 16px;
    max-width: 80%;
    font-size: 13.5px;
    line-height: 1.6;
    color: #e6edf3;
}

/* System/AI message: full width, no bubble */
.message.system-msg {
    align-items: flex-start;
}

.message.system-msg .msg-content {
    background: transparent;
    border: none;
    padding: 0;
    max-width: 100%;
    font-size: 13.5px;
    line-height: 1.75;
    color: #c9d1d9;
}

/* Hide avatars completely (Antigravity doesn't show them by default) */
.avatar {
    display: none;
}

/* Markdown inside messages */
.msg-content p {
    margin-bottom: 8px;
}
.msg-content p:last-child { margin-bottom: 0; }

.msg-content h1, .msg-content h2, .msg-content h3 {
    margin: 14px 0 6px;
    font-weight: 600;
    color: #e6edf3;
}

.msg-content ul, .msg-content ol {
    padding-left: 20px;
    margin-bottom: 8px;
}

.msg-content li { margin-bottom: 3px; }

.msg-content strong { color: #e6edf3; font-weight: 600; }

/* Code blocks — Antigravity dark style */
.msg-content pre {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 10px 0;
    overflow-x: auto;
    position: relative;
}

.msg-content code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: #e6edf3;
}

.msg-content p code {
    background-color: rgba(110,118,129,0.15);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #30363d;
    color: #e6edf3;
    font-size: 12px;
}

.msg-content blockquote {
    border-left: 3px solid #30363d;
    padding-left: 14px;
    color: #8b949e;
    margin: 8px 0;
}

/* --- Chat Input Area (Antigravity/Claude style) --- */
.chat-input-area {
    padding: 8px 12px 12px;
    flex-shrink: 0;
    position: relative;
}

/* Image preview strip */
.image-preview-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    padding: 6px 4px 0;
}
.image-preview-strip.hidden { display: none; }

.image-preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #30363d;
    flex-shrink: 0;
}
.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.7);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}

/* Main input card */
.input-card {
    background-color: #1c2128;
    border: 1px solid #30363d;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-card:focus-within {
    border-color: #388bfd55;
    box-shadow: 0 0 0 2px rgba(56,139,253,0.12);
}

.input-card textarea {
    background: transparent;
    border: none;
    color: #c9d1d9;
    font-family: var(--font-ui);
    font-size: 13.5px;
    padding: 12px 14px 6px;
    resize: none;
    outline: none;
    min-height: 40px;
    max-height: 200px;
    line-height: 1.55;
    width: 100%;
    box-sizing: border-box;
}
.input-card textarea::placeholder { color: #6e7681; }

/* Footer toolbar row */
.input-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px 7px;
    gap: 6px;
}
.input-left-actions, .input-right-actions, .input-center-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.input-center-actions {
    position: relative;
    flex: 1;
}

/* + button (attach) */
.input-action-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #8b949e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s;
}
.input-action-btn:hover {
    border-color: #6e7681;
    color: #c9d1d9;
    background: #21262d;
}

/* Model pill button */
.model-pill-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.model-pill-btn:hover {
    background: #21262d;
    color: #c9d1d9;
}

/* Model dropdown */
.model-pill-dropdown {
    position: absolute;
    bottom: 36px;
    left: 0;
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 100;
    min-width: 160px;
    overflow: hidden;
}
.model-pill-dropdown.hidden { display: none; }
.model-pill-option {
    padding: 9px 14px;
    font-size: 12.5px;
    color: #8b949e;
    cursor: pointer;
    transition: background 0.12s;
}
.model-pill-option:hover { background: #21262d; color: #c9d1d9; }
.model-pill-option.active { color: #79c0ff; background: #1f3a5a; }

/* Send button — round blue */
.send-btn-new {
    background-color: #2f81f7;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.15s, transform 0.1s;
    flex-shrink: 0;
}
.send-btn-new:hover { background-color: #388bfd; transform: scale(1.05); }
.send-btn-new:disabled {
    background-color: #21262d;
    color: #6e7681;
    cursor: not-allowed;
    transform: none;
}


/* Loading / typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 0;
    color: #8b949e;
    font-size: 12px;
}
.typing-indicator span {
    width: 5px;
    height: 5px;
    background-color: #6e7681;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.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.4); }
    40%           { transform: scale(1); }
}

/* --- Tool Confirm Modal (Antigravity-style) --- */
.tool-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tool-confirm-overlay.hidden { display: none; }

.tool-confirm-card {
    width: 420px;
    max-width: 92%;
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

.tool-confirm-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #30363d;
    font-size: 13px;
    font-weight: 500;
    color: #c9d1d9;
    background: #161b22;
}

.tool-confirm-body {
    padding: 14px 16px;
}

.tool-confirm-command {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    margin-bottom: 12px;
    max-height: 250px;
    overflow-y: auto;
}

.tool-confirm-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tool-confirm-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12.5px;
    color: #8b949e;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.tool-confirm-option:hover {
    background: #21262d;
    color: #c9d1d9;
    border-color: #30363d;
}

.tool-confirm-option.selected {
    background: #1f3a5a;
    color: #79c0ff;
    border-color: #388bfd;
}

.opt-num {
    width: 20px;
    height: 20px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #8b949e;
    flex-shrink: 0;
}

.tool-confirm-option.selected .opt-num {
    background: #388bfd;
    border-color: #388bfd;
    color: white;
}

.tool-confirm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #30363d;
    background: #161b22;
}

.tc-skip-btn {
    background: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12.5px;
    transition: all 0.15s;
}
.tc-skip-btn:hover { border-color: #6e7681; color: #c9d1d9; }

.tc-submit-btn {
    background: #238636;
    border: 1px solid #2ea043;
    color: white;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    transition: background 0.15s;
}
.tc-submit-btn:hover { background: #2ea043; }

/* --- Stop Button --- */
.stop-btn {
    background: rgba(248,81,73,0.12);
    border: 1px solid rgba(248,81,73,0.4);
    color: #f85149;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.15s;
    animation: pulse-stop 1.5s infinite;
}
.stop-btn:hover { background: rgba(248,81,73,0.25); }
.stop-btn.hidden { display: none; }

@keyframes pulse-stop {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248,81,73,0.4); }
    50%       { box-shadow: 0 0 0 4px rgba(248,81,73,0); }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    gap: 15px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.user-msg .avatar {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}

.msg-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    line-height: 1.6;
    color: var(--text-main);
}

.user-msg .msg-content {
    background-color: var(--border-light);
}

/* Markdown styling inside msg-content */
.msg-content p {
    margin-bottom: 10px;
}
.msg-content p:last-child {
    margin-bottom: 0;
}
.msg-content pre {
    background-color: var(--bg-base);
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow-x: auto;
    margin: 15px 0;
}
.msg-content code {
    font-family: var(--font-mono);
    font-size: 13px;
    color: #e6edf3;
}
.msg-content p code {
    background-color: var(--bg-base);
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid var(--border);
}

/* --- Chat Area --- */
.chat-area {
    padding: 15px;
    font-size: 13px;
}
.chat-input-area {
    padding: 15px 15px 25px;
}

.input-wrapper {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

textarea {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 14px;
    padding: 15px;
    resize: none;
    outline: none;
    min-height: 56px;
    max-height: 200px;
    line-height: 1.5;
}

textarea::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid var(--border-light);
}

.model-select {
    background-color: var(--bg-base);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
}

.send-btn {
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.2s;
}

.send-btn:hover {
    background-color: var(--accent-hover);
}

.send-btn:disabled {
    background-color: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

.input-footer {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Loading animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 5px;
}
.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.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); }
    40% { transform: scale(1); }
}

/* --- LOGIN SCREEN (FUTURISTIC CLEAN) --- */
.login-screen {
    position: absolute;
    top: 0; /* Cover titlebar */
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #102a5c 0%, #081124 60%, #03060c 100%);
    animation: pulseBG 10s ease-in-out infinite alternate;
}

@keyframes pulseBG {
    0% { background-size: 100% 100%; }
    100% { background-size: 110% 110%; }
}

.login-screen.hidden {
    display: none;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-logo {
    width: 72px;
    height: 72px;
    margin-bottom: 24px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

.login-container h2 {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.8px;
}

.login-container p {
    color: #8b949e;
    font-size: 15px;
    margin-bottom: 40px;
}

.login-buttons-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.idd-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #7e22ce 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(47, 129, 247, 0.4);
}

.idd-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(126, 34, 206, 0.6);
}

.idd-btn i {
    font-size: 20px;
}

/* --- CONTEXT MENU --- */
.context-menu {
    position: fixed;
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    padding: 5px 0;
    min-width: 220px;
    z-index: 100000;
    display: none;
    flex-direction: column;
}

.context-menu.show {
    display: flex;
}

.context-menu-item {
    padding: 6px 12px;
    color: var(--text-main);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.context-menu-item:hover {
    background-color: var(--accent);
    color: white;
}

.context-menu-divider {
    height: 1px;
    background-color: var(--border);
    margin: 5px 0;
}

.context-shortcut {
    color: var(--text-muted);
    font-size: 11px;
}

.context-menu-item:hover .context-shortcut {
    color: rgba(255, 255, 255, 0.7);
}

/* --- CUSTOM MODAL --- */
.custom-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.custom-modal.hidden {
    display: none !important;
}

.custom-modal-content {
    background-color: #252526;
    border: 1px solid #454545;
    border-radius: 4px;
    width: 480px;
    padding: 16px 20px 20px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: slideDownModal 0.15s ease-out;
    position: relative;
    color: #cccccc;
}

@keyframes slideDownModal {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-body-flex {
    display: flex;
    gap: 16px;
}

.modal-icon {
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
}

.modal-icon i {
    font-size: 32px;
    color: #3794ff;
}

.modal-text-content {
    flex: 1;
}

.custom-modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.4;
}

.custom-modal-content p {
    margin: 0 0 20px 0;
    font-size: 13px;
    color: #cccccc;
    line-height: 1.4;
    word-break: break-all;
}

.custom-modal-content input {
    width: 100%;
    background-color: var(--bg-base);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 2px;
    margin-bottom: 15px;
    outline: none;
    font-size: 13px;
}

.custom-modal-content input:focus {
    border-color: #0078d4;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
}

.modal-actions button {
    padding: 6px 16px;
    border-radius: 2px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    font-weight: 500;
    transition: background-color 0.1s;
}

.btn-secondary {
    background-color: transparent;
    color: #cccccc;
    border: 1px solid #454545 !important;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-primary {
    background-color: #0078d4;
    color: white;
}

.btn-primary:hover {
    background-color: #026ec1;
}

.btn-danger {
    background-color: #d13438;
    color: white;
}

.btn-danger:hover {
    background-color: #b02a2d;
}

/* --- TERMINAL AREA --- */
.terminal-panel {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 250px;
    min-height: 100px;
    max-height: 80vh;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-base);
    padding: 0 15px;
    height: 35px;
    border-bottom: 1px solid var(--border);
}

.terminal-tabs {
    display: flex;
    gap: 15px;
    height: 100%;
}

.terminal-tabs .tab {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    
    /* Overrides */
    min-width: 0;
    border-right: none;
    border-top: none;
    padding: 0;
    background-color: transparent;
}

.terminal-tabs .tab.active {
    color: var(--text-main);
    border-bottom: 1px solid var(--accent);
}

.terminal-actions {
    display: flex;
    gap: 10px;
}

.terminal-actions button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
}

.terminal-actions button:hover {
    color: var(--text-main);
}

.terminal-content {
    flex: 1;
    background-color: var(--bg-surface);
    padding: 0 10px; /* Only side padding */
    overflow: hidden;
    position: relative;
}

.resizer-horizontal {
    height: 4px;
    background-color: transparent;
    cursor: row-resize;
    transition: background-color 0.2s;
    width: 100%;
}

.resizer-horizontal:hover, .resizer-horizontal:active {
    background-color: var(--accent);
}

/* Override xterm.js styles for better integration */
.xterm-viewport {
    background-color: transparent !important;
}
.xterm-helper-textarea {
    outline: none !important;
}

/* --- Status Bar --- */
.status-bar {
    height: 22px;
    background-color: var(--bg-base);
    color: var(--text-main);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    padding: 0;
    user-select: none;
    flex-shrink: 0;
    border-top: 1px solid #2d2d2d;
}
.status-bar-left {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 0;
}
.status-bar-right {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 0;
    padding: 0 4px;
}
.status-item {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
    padding: 0 8px;
    cursor: pointer;
    transition: background 0.15s;
    color: #cccccc;
}
.status-item:hover {
    background-color: rgba(255, 255, 255, 0.12);
}
/* Only Problems button (left side) gets blue background */
.status-bar-left .status-item {
    background-color: #007acc;
    color: #ffffff;
}
.status-bar-left .status-item:hover {
    background-color: #1a8ad4;
}

/* ===========================
   SETTINGS MODAL
   =========================== */
.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.settings-overlay.hidden { display: none; }

.settings-dialog {
    width: 860px;
    max-width: 95vw;
    height: 580px;
    max-height: 90vh;
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 10px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    animation: fadeIn 0.2s ease;
}

/* Left Nav */
.settings-nav {
    width: 200px;
    flex-shrink: 0;
    background: #161b22;
    border-right: 1px solid #21262d;
    display: flex;
    flex-direction: column;
}
.settings-nav-header {
    padding: 18px 16px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #6e7681;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid #21262d;
    margin-bottom: 6px;
}
.settings-nav-items {
    display: flex;
    flex-direction: column;
    padding: 4px 8px;
    gap: 2px;
    flex: 1;
}
.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    transition: background 0.12s, color 0.12s;
    width: 100%;
}
.settings-nav-item:hover {
    background: #21262d;
    color: #c9d1d9;
}
.settings-nav-item.active {
    background: #2d333b;
    color: #79c0ff;
}
.settings-nav-item i { font-size: 15px; }

/* Right Content */
.settings-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.settings-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #21262d;
    font-size: 14px;
    font-weight: 600;
    color: #e6edf3;
    flex-shrink: 0;
}
.settings-close-btn {
    background: none;
    border: none;
    color: #6e7681;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.settings-close-btn:hover { color: #c9d1d9; }

/* Panels */
.settings-panel {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 32px;
}
.settings-panel.active { display: block; }

.settings-section {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid #21262d;
}
.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 14px;
}
.settings-section-title.danger { color: #f85149; }

.settings-hint {
    font-size: 12px;
    color: #6e7681;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* User card */
.settings-user-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 16px 18px;
}
.settings-avatar {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #2f81f7, #1a6fd4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
}
.settings-user-name {
    font-size: 15px;
    font-weight: 600;
    color: #e6edf3;
    margin-bottom: 3px;
}
.settings-user-nik {
    font-size: 12px;
    color: #6e7681;
    margin-bottom: 5px;
}
.settings-user-credits {
    font-size: 12px;
    color: #3fb950;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Form Elements */
.settings-form-group {
    margin-bottom: 14px;
}
.settings-form-group label {
    display: block;
    font-size: 12px;
    color: #8b949e;
    margin-bottom: 6px;
    font-weight: 500;
}
.settings-input {
    width: 100%;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 13px;
    padding: 9px 12px;
    outline: none;
    box-sizing: border-box;
    font-family: var(--font-ui);
    transition: border-color 0.15s;
}
.settings-input:focus { border-color: #388bfd; }
.settings-input:disabled { opacity: 0.5; cursor: not-allowed; }

.settings-select {
    width: 100%;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 13px;
    padding: 9px 12px;
    outline: none;
    cursor: pointer;
    font-family: var(--font-ui);
}

.settings-eye-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6e7681;
    cursor: pointer;
    font-size: 16px;
}

/* Buttons */
.settings-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    background: #2f81f7;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 6px;
}
.settings-save-btn:hover { background: #388bfd; }

.settings-danger-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    background: transparent;
    color: #f85149;
    border: 1px solid #f85149;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 6px;
}
.settings-danger-btn:hover { background: rgba(248,81,73,0.12); }

.settings-danger-zone {
    background: rgba(248,81,73,0.05);
    border-color: rgba(248,81,73,0.2);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(248,81,73,0.2);
}

/* Range slider */
.settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.settings-range {
    flex: 1;
    accent-color: #2f81f7;
    cursor: pointer;
}
.settings-range-val {
    font-size: 12px;
    color: #79c0ff;
    min-width: 32px;
    text-align: right;
}

/* Toggle switch */
.settings-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}
.settings-toggle-label span { font-size: 13px; color: #c9d1d9; }
.settings-toggle {
    position: relative;
    width: 38px;
    height: 20px;
    flex-shrink: 0;
}
.settings-toggle input { display: none; }
.settings-toggle-slider {
    position: absolute;
    inset: 0;
    background: #30363d;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}
.settings-toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
}
.settings-toggle input:checked + .settings-toggle-slider { background: #2f81f7; }
.settings-toggle input:checked + .settings-toggle-slider::before { transform: translateX(18px); }

/* Theme cards */
.settings-theme-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.settings-theme-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #161b22;
    border: 2px solid #30363d;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s;
    color: #8b949e;
    font-size: 12px;
}
.settings-theme-card:hover { border-color: #6e7681; }
.settings-theme-card.active { border-color: #2f81f7; color: #79c0ff; }
.theme-preview {
    width: 80px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
}
.dark-preview { background: linear-gradient(to bottom, #1c2128 0%, #1c2128 40%, #161b22 40%, #161b22 100%); }
.darker-preview { background: linear-gradient(to bottom, #0d1117 0%, #0d1117 40%, #090c10 40%, #090c10 100%); }
.midnight-preview { background: linear-gradient(to bottom, #0a1628 0%, #0a1628 40%, #061020 40%, #061020 100%); }

/* About section */
.settings-about-logo {
    text-align: center;
    padding: 20px 0 24px;
}
.settings-about-logo h2 {
    font-size: 20px;
    font-weight: 700;
    color: #e6edf3;
    margin: 12px 0 4px;
}
.settings-about-info {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
}
.settings-about-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #30363d;
    font-size: 13px;
}
.settings-about-row:last-child { border-bottom: none; }
.settings-about-label { color: #8b949e; }
.settings-about-value { color: #c9d1d9; font-family: var(--font-mono); }

/* --- Login Modal Updates --- */
.google-btn {
    width: 100%;
    padding: 14px;
    background: #ffffff;
    color: #1f2328;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s;
    font-family: var(--font-ui);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.google-btn:hover { 
    background: #f6f8fa; 
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15); 
}
.google-btn i { font-size: 20px; }

.idd-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: #c9d1d9;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.idd-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: transparent;
    border-color: transparent;
}
.badge {
    background: #4a154b;
    color: #d1d2d3;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

/* --- Subscription Card --- */
.subscription-card {
    background: linear-gradient(135deg, rgba(47, 129, 247, 0.05) 0%, rgba(138, 43, 226, 0.05) 100%);
    border: 1px solid rgba(47, 129, 247, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
}
.sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(47, 129, 247, 0.2);
}
.sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(47, 129, 247, 0.15);
    color: #58a6ff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.sub-badge i { color: #f1e05a; }
.sub-status {
    font-size: 11px;
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
}
.sub-body {
    display: flex;
    justify-content: space-between;
}
.sub-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sub-label {
    font-size: 11px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sub-value {
    font-size: 15px;
    font-weight: 600;
    color: #e6edf3;
}
.settings-user-email {
    font-size: 12px;
    color: #8b949e;
}

/* --- Sidebar Views & Search --- */
.sidebar {
    display: flex;
    flex-direction: column;
}
.sidebar-view {
    display: none;
    flex-direction: column;
    height: 100%;
}
.sidebar-view.active {
    display: flex;
}
.search-panel-container {
    padding: 10px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}
.search-input-ui {
    width: 100%;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #c9d1d9;
    padding: 6px 10px;
    font-size: 12px;
    font-family: var(--font-ui);
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 10px;
}
.search-input-ui:focus { border-color: #58a6ff; }
.search-results-list {
    flex: 1;
    overflow-y: auto;
}
.search-result-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    color: #c9d1d9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
    word-break: break-all;
}
.search-result-item:hover {
    background: #161b22;
}
.search-result-item i {
    color: #8b949e;
    flex-shrink: 0;
}

/* --- Generic Modal System --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
}
.modal-overlay.hidden {
    display: none !important;
}
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-body {
    padding: 20px;
    overflow-y: auto;
}

/* --- Pricing Page --- */
.pricing-page {
    position: fixed;
    top: 30px; /* Below titlebar */
    left: 0; right: 0; bottom: 0;
    background: #0d1117;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    overflow-y: auto;
}
.pricing-page.hidden {
    display: none !important;
}
.pricing-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    width: 100%;
    max-width: 1000px;
}
.pricing-body {
    display: flex;
    gap: 30px;
    max-width: 1000px;
    width: 100%;
    justify-content: center;
}

.pricing-card {
    background: rgba(22, 27, 34, 0.8);
    border: 1px solid #30363d;
    border-radius: 6px; /* Less rounded */
    padding: 40px; /* Larger padding */
    width: 320px; /* Fixed larger width */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}
.pricing-card:hover {
    transform: translateY(-5px);
    border-color: #58a6ff;
}
.pricing-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #c9d1d9;
}
.pricing-card .price {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
}
.pricing-card .price span {
    font-size: 13px;
    color: #8b949e;
    font-weight: 500;
}
.pricing-card .features {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
    flex: 1;
}
.pricing-card .features li {
    font-size: 13px;
    color: #8b949e;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pricing-card .features li i {
    color: #3fb950;
    font-weight: bold;
}
.pricing-card.recommended {
    border-color: #102a5c;
    background: linear-gradient(180deg, rgba(16,42,92,0.5) 0%, rgba(22,27,34,0.8) 100%);
}
.pricing-card.premium-card {
    border-color: #5c1a9c;
    background: linear-gradient(180deg, rgba(92,26,156,0.3) 0%, rgba(22,27,34,0.8) 100%);
}
.pricing-card .ribbon {
    position: absolute;
    top: 15px;
    right: -30px;
    background: #2f81f7;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 4px 30px;
    transform: rotate(45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.btn-pilih-paket {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

/* --- Invoice Banner --- */
.invoice-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #a41e22; /* Red warning */
    color: #fff;
    padding: 10px 20px;
    font-size: 13px;
    z-index: 9999;
}
.invoice-banner.hidden {
    display: none !important;
}
.invoice-content {
    display: flex;
    align-items: center;
    gap: 10px;
}
.invoice-content i {
    font-size: 18px;
    color: #ffd33d;
}
.pay-invoice-btn {
    background: #fff;
    color: #a41e22;
    border: none;
    padding: 6px 15px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.pay-invoice-btn:hover {
    background: #ffd33d;
}
