:root {
    /* Restoring Original Dark Tone */
    --bg-dark: #030305;
    --bg-sidebar: rgba(10, 10, 15, 0.7);
    --bg-card: rgba(255, 255, 255, 0.02);
    --bg-card-hover: rgba(255, 255, 255, 0.04);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --primary: #818cf8;
    --secondary: #c084fc;
    --accent: #f472b6;

    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: 'JetBrains Mono', monospace;

    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --glass-border: 1px solid rgba(255, 255, 255, 0.06);
    --card-radius: 16px;

    /* Animation Variables */
    --glow-primary: rgba(129, 140, 248, 0.4);
}

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

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background (Restored) */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.bg-glow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    filter: blur(80px);
}

.glow-blob {
    position: absolute;
    border-radius: 50%;
    width: 600px;
    height: 600px;
    opacity: 0.6;
    mix-blend-mode: screen;
    animation: move 15s infinite alternate;
}

/* Dashboard Specific Background Overrides */
.dashboard-page .glow-blob {
    opacity: 0.25;
    /* Slightly visible but suppressed */
    filter: blur(80px) saturate(0.7);
    /* Softened and slightly desaturated */
}

/* Make grid slightly less visible too on dashboard */
.dashboard-page .bg-grid {
    opacity: 0.5;
}

.glow-1 {
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.8) 0%, rgba(129, 140, 248, 0) 70%);
    animation-duration: 20s;
}

.glow-2 {
    bottom: -100px;
    right: -100px;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.8) 0%, rgba(192, 132, 252, 0) 70%);
    animation-duration: 25s;
    animation-delay: -5s;
}

.glow-3 {
    top: 30%;
    left: 20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(244, 114, 182, 0.8) 0%, rgba(244, 114, 182, 0) 70%);
    animation-duration: 18s;
    animation-delay: -10s;
}

.glow-4 {
    bottom: 20%;
    left: 30%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.8) 0%, rgba(59, 130, 246, 0) 70%);
    animation-duration: 22s;
    animation-delay: -7s;
}

@keyframes move {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    33% {
        transform: translate(150px, 50px) rotate(90deg) scale(1.1);
    }

    66% {
        transform: translate(-50px, 150px) rotate(180deg) scale(0.9);
    }

    100% {
        transform: translate(0, 0) rotate(360deg) scale(1);
    }
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    /* Changed from just display: flex */
    color: var(--text-primary);
    /* Ensure color persists */
}

.logo i {
    color: var(--primary);
    font-size: 1.5rem;
}

.new-analysis-btn {
    margin: 15px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.new-analysis-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.history-section {
    padding: 15px;
}

.history-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    font-weight: 600;
}

.icon-btn-small {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn-small:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Folder Styling */
.history-folder {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.folder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.folder-header:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.folder-header i.arrow {
    font-size: 1rem;
    transition: transform 0.2s;
}

.history-folder.collapsed .folder-header i.arrow {
    transform: rotate(-90deg);
}

.folder-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    margin-left: 18px;
}

.history-folder.collapsed .folder-content {
    display: none;
}

.history-item {
    position: relative;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.history-item.active {
    background: rgba(129, 140, 248, 0.1);
    color: var(--primary);
}

.history-item .menu-trigger {
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s;
}

.history-item:hover .menu-trigger {
    opacity: 1;
}

.history-item.active {
    background: rgba(129, 140, 248, 0.15);
    /* var(--primary) is #818cf8 */
    color: var(--text-primary);
}

.history-item i {
    color: var(--text-muted);
}

/* History Item Context Menu */
.history-item {
    position: relative;
}

.history-item .menu-trigger {
    opacity: 0;
    margin-left: auto;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
}

.history-item:hover .menu-trigger {
    opacity: 1;
}

.history-item .menu-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* History Tree Structure */
.history-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 34px;
    /* Indent */
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s;
    position: relative;
    /* Connecting line */
}

.history-sub-item:before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 50%;
    width: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 4px;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    display: none;
    /* Optional: Draw lines if desired, keeping simple for now */
}

.history-sub-item:hover {
    background: rgba(255, 255, 255, 0.05);
    /* Neutral hover */
    color: var(--text-primary);
}

.history-sub-item i {
    font-size: 1.1rem;
    opacity: 0.7;
    color: #94a3b8;
    /* Slate-400 */
}

.menu-dropdown {
    position: absolute;
    right: 10px;
    top: 100%;
    background: rgba(30, 35, 45, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 0;
    min-width: 160px;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: none;
}

.menu-dropdown.active {
    display: block;
}

.menu-dropdown .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s;
}

.menu-dropdown .menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.menu-dropdown .menu-item.danger {
    color: var(--danger);
}

.menu-dropdown .menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Sidebar Scroll Area */
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Sidebar Navigation Area */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.repos-section {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.3);
}

.repos-section.hidden {
    display: none;
}

/* Repos Section Specifics */
.repos-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.repos-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.repo-item {
    position: relative;
    /* REQUIRED for absolute menu */
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.repo-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.repo-item i {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.repo-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.private-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 4px;
}

/* Repo Menu Trigger */
.repo-menu-trigger {
    padding: 4px;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 1.2rem;
    opacity: 0.6;
    transition: all 0.2s;
}

.repo-item:hover .repo-menu-trigger {
    opacity: 1;
}

/* Repo Dropdown Menu - Modern Overlaid Style */
.repo-menu {
    position: absolute;
    top: 5px;
    right: 40px;
    /* Positioned to the left of the dots icon */
    width: 170px;
    background: #1c1c1f;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    z-index: 10001;
    /* Very high to overlay and avoid clipping */
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.repo-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.repo-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.repo-menu .menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Sidebar Footer & Settings */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    position: relative;
    /* For popover positioning */
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    background: transparent;
    border: none;
    text-align: left;
    color: var(--text-primary);
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar-container {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    /* ChatGPT style is slightly rounded square or circle */
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.menu-icon {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Settings Popover - ChatGPT Style */
.settings-menu {
    position: absolute;
    bottom: 100%;
    left: 8px;
    width: 240px;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-profile-header {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
}

.settings-profile-header .user-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-menu .menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-menu .menu-item>div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-menu .menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.settings-menu .menu-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.settings-menu .shortcut {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.settings-menu .menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 4px 0;
}

#upgradePlanBtn {
    color: #f59e0b;
    /* Amber */
}

#upgradePlanBtn:hover {
    background: rgba(245, 158, 11, 0.1);
}

.settings-menu .menu-item.danger {
    color: #f87171;
}

.settings-menu .menu-item.danger:hover {
    background: rgba(248, 113, 113, 0.1);
}

.settings-menu .lang-val {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: auto;
}

/* Login Button (matches user-menu-btn style but simplified) */
.login-btn-sidebar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 500;
    font-family: var(--font-main);
    justify-content: center;
    transition: filter 0.2s;
}

.login-btn-sidebar:hover {
    filter: brightness(1.1);
}

/* Main Content */
.main-content {
    height: 100vh;
    overflow-y: auto;
    background: transparent;
    /* CRITICAL: Transparent to show bg-grid/blobs */
}



/* Welcome Screen */
.welcome-screen {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Removed the radial-gradient that was hiding the blobs */
    background: transparent;
}

.welcome-content {
    text-align: center;
    max-width: 900px;
    /* Increased from 700px */
    padding: 60px 40px;
    width: 100%;
}

/* Badge in Welcome Screen */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(129, 140, 248, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease-out;
}

.badge i {
    font-size: 1rem;
}

.welcome-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.input-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 8px 8px 8px 20px;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-top: 30px;
    /* Added spacing from subtitle */
}

.input-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 4px 30px rgba(129, 140, 248, 0.2);
}

.input-box>i {
    color: var(--text-muted);
    font-size: 1.6rem;
    flex-shrink: 0;
}

.input-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-code);
    font-size: 1rem;
    padding: 16px 0;
    outline: none;
    min-width: 0;
}

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

.analyze-btn {
    padding: 16px 28px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 12px;
    color: white;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: filter 0.2s ease;
    white-space: nowrap;
}

.analyze-btn:hover {
    filter: brightness(1.15);
}

.analyze-btn i {
    font-size: 1.2rem;
}

/* Model Selector */
.model-selector-container {
    position: relative;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 12px;
}

.model-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 32px 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    min-width: 160px;
}

.model-select:hover,
.model-select:focus {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
    outline: none;
}

.model-select option {
    background: #18181b;
    color: var(--text-primary);
    padding: 12px;
}

/* Loading Screen */
.loading-screen {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.hidden {
    display: none !important;
}

/* Analysis View */
.analysis-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-sidebar);
}

.repo-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.repo-info i {
    font-size: 1.3rem;
    color: var(--text-muted);
}

.analysis-tabs {
    display: flex;
    gap: 5px;
}

.tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    background: var(--primary);
    color: white;
}

.tab-panels {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Metrics Row */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.metric-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    border-radius: var(--card-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card:hover {
    transform: translateY(-2px);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-color: var(--border-hover);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
}

.metric-card.health::before {
    background: linear-gradient(90deg, var(--success), var(--primary));
}

.metric-card.issues-count::before {
    background: var(--warning);
}

.metric-card.critical-count::before {
    background: var(--danger);
}

.metric-card.security-count::before {
    background: #f97316;
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.metric-card.health .metric-icon {
    color: var(--success);
}

.metric-card.issues-count .metric-icon {
    color: var(--warning);
}

.metric-card.critical-count .metric-icon {
    color: var(--danger);
}

.metric-card.security-count .metric-icon {
    color: #f97316;
}

.metric-info {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Summary Section */
.summary-section {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.summary-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 1rem;
    color: var(--text-primary);
}

.summary-section h3 i {
    color: var(--primary);
}

.summary-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Issues Section */
.issues-section {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.section-header h3 i {
    color: var(--primary);
}

.issue-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.issues-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.issue-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 16px;
    border-left: 4px solid var(--warning);
    transition: transform 0.2s, box-shadow 0.2s;
}

.issue-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.issue-item.critical {
    border-left-color: var(--danger);
}

.issue-item.high {
    border-left-color: #f97316;
}

.issue-item.medium {
    border-left-color: var(--warning);
}

.issue-item.low {
    border-left-color: var(--success);
}

/* Issue Actions */
.issue-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.fix-prompt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(129, 140, 248, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: 6px;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.fix-prompt-btn:hover {
    background: rgba(129, 140, 248, 0.2);
    border-color: var(--primary);
}

.fix-prompt-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--success);
    color: var(--success);
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.issue-title {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.issue-meta {
    display: flex;
    gap: 8px;
}

.issue-badge {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.issue-badge.severity {
    font-weight: 600;
}

.issue-badge.severity.critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.issue-badge.severity.high {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.issue-badge.severity.medium {
    background: rgba(234, 179, 8, 0.2);
    color: var(--warning);
}

.issue-badge.severity.low {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

/* Badge Button */
.badge-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
}

.badge-btn:hover {
    transform: scale(1.05);
}

/* Bottom Grid for Strengths/Competitors */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.info-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.info-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 1rem;
}

.info-card.strengths h3 i {
    color: var(--success);
}

.info-card.competitors h3 i {
    color: var(--accent);
}

.custom-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.custom-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.custom-list li::before {
    content: '•';
    color: var(--primary);
    font-weight: bold;
}

.custom-list li:last-child {
    border-bottom: none;
}

/* Chat UI */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.message {
    display: flex;
    margin-bottom: 10px;
}

.message.user {
    justify-content: flex-end;
}

.message.model {
    justify-content: flex-start;
}

.message.system {
    justify-content: center;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.message.user .message-content {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.model .message-content {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message.system .message-content {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 20px;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
}

.chat-input-area input:focus {
    border-color: var(--primary);
}

.chat-input-area button {
    padding: 0 20px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-input-area button:hover {
    background: var(--secondary);
}

/* Badge Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #1a1b26;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    padding: 25px;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.hidden .modal-content {
    transform: scale(0.9);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.2rem;
    margin: 0;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.settings-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
}

.settings-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}

.settings-help {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.settings-help.status-ok {
    color: var(--success);
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.settings-btn {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-main);
}

.settings-btn.primary {
    background: var(--primary);
    color: #fff;
}

.settings-btn.primary:hover {
    filter: brightness(1.05);
}

.settings-btn.ghost {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.settings-btn.ghost:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.badge-preview {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 20px;
}

.code-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.code-label {
    position: absolute;
    top: -10px;
    left: 10px;
    background: #1a1b26;
    /* should match modal bg */
    padding: 0 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.code-box code {
    flex: 1;
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: var(--secondary);
    white-space: nowrap;
    overflow-x: auto;
}

.copy-code-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.copy-code-btn:hover {
    color: var(--primary);
}

/* Markdown Styles for README/Chat (Simplified) */
.markdown-body {
    color: #c9d1d9;
    font-size: 0.95rem;
    line-height: 1.6;
    background: rgba(13, 17, 23, 0.8);
    /* Dark opaque background */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.markdown-body p {
    margin-bottom: 15px;
}

.markdown-body code {
    background: rgba(110, 118, 129, 0.4);
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-family: var(--font-code);
    font-size: 85%;
}

.markdown-body pre {
    background: #161b22;
    padding: 16px;
    border-radius: 6px;
    overflow: auto;
    margin-bottom: 15px;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.markdown-body a {
    color: #58a6ff;
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1200px) {
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .metrics-row {
        grid-template-columns: 1fr;
    }

    .grid-2-col {
        grid-template-columns: 1fr;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Recommendations */
.recommendations-grid {
    display: grid;
    gap: 12px;
}

.recommendation-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.2s;
}

.recommendation-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary);
}

.rec-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(129, 140, 248, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

.rec-icon i {
    font-size: 1.3rem;
    color: var(--primary);
}

.rec-content h4 {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rec-content p {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.rec-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rec-priority {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.rec-prompt-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.rec-prompt-btn:hover {
    background: rgba(129, 140, 248, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* Info Button */
.info-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s;
}

.info-btn:hover {
    opacity: 1;
    color: var(--primary);
}

.metric-card {
    position: relative;
}

/* Scoring Info Modal */
.scoring-info-modal {
    max-width: 500px;
}

.scoring-info-modal h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.scoring-info-modal h2 i {
    color: var(--primary);
}

.scoring-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.scoring-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.scoring-section h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.scoring-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.scoring-section ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.scoring-section li {
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.scoring-section .deduct {
    display: inline-block;
    width: 40px;
    font-weight: 600;
    color: var(--danger);
}

.score-ranges {
    display: grid;
    gap: 8px;
}

.score-ranges .range {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-ranges .range span {
    font-weight: 700;
    min-width: 60px;
}

.range.elite {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.range.pro {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.range.avg {
    background: rgba(234, 179, 8, 0.1);
    color: var(--warning);
}

.range.poor {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Repo Item Menu */
.repo-item {
    position: relative;
}

.repo-menu-trigger {
    opacity: 0;
    margin-left: auto;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
}



/* ===== ENHANCED RECOMMENDATIONS SECTION ===== */
.recommendations-section.highlight-section {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
}

.recommendations-section .section-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.section-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
    margin-bottom: 20px;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.recommendation-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    transition: all 0.3s;
}

.recommendation-card:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-3px);
}

.rec-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rec-icon i {
    font-size: 1.4rem;
    color: white;
}

.rec-content {
    flex: 1;
}

.rec-content h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.rec-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.rec-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rec-priority {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.rec-prompt-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.rec-prompt-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ===== ENHANCED ISSUES / TESPITLER SECTION ===== */

/* Issues Grid */
.issues-grid {
    display: grid;
    gap: 15px;
}

/* Issue Card */
.issue-item {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--text-muted);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.issue-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.issue-item:hover::before {
    opacity: 1;
}

.issue-item:hover {
    transform: translateX(5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Severity-based left border colors */
.issue-item.critical {
    border-left-color: #ef4444;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0%, transparent 30%);
}

.issue-item.high {
    border-left-color: #f97316;
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.08) 0%, transparent 30%);
}

.issue-item.medium {
    border-left-color: #eab308;
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.05) 0%, transparent 30%);
}

.issue-item.low {
    border-left-color: #22c55e;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.05) 0%, transparent 30%);
}

/* Issue Header */
.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 12px;
}

.issue-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.issue-meta {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.issue-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.issue-badge.severity {
    color: white;
}

.issue-badge.severity.critical {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.issue-badge.severity.high {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.issue-badge.severity.medium {
    background: linear-gradient(135deg, #eab308, #ca8a04);
}

.issue-badge.severity.low {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

/* Issue Description */
.issue-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Issue Actions */
.issue-actions {
    display: flex;
    justify-content: flex-end;
}

.fix-prompt-btn {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-family: inherit;
}

.fix-prompt-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.02);
}

.fix-prompt-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Filter Buttons */
.issue-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Issues Tab Header */
#issues-panel .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

/* ===== INTEGRATED AI CHAT PANEL ===== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 250px);
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    margin-top: 10px;
}

.chat-messages-modern {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.chat-messages-modern .message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.chat-messages-modern .message.user {
    align-self: flex-end;
}

.chat-messages-modern .message.model {
    align-self: flex-start;
}

.chat-messages-modern .message-content {
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.chat-messages-modern .message.user .message-content {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 10px 25px -5px rgba(129, 140, 248, 0.3);
}

.chat-messages-modern .message.model .message-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 2px;
}

.chat-messages-modern .message.system .message-content {
    background: rgba(129, 140, 248, 0.05);
    color: var(--primary);
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid rgba(129, 140, 248, 0.1);
}

.chat-input-area-modern {
    padding: 24px;
    background: rgba(30, 41, 59, 0.8);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
}

.chat-input-area-modern input {
    flex: 1;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 20px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.chat-input-area-modern input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}

.chat-input-area-modern button {
    width: 52px;
    height: 52px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-input-area-modern button:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(129, 140, 248, 0.4);
}

/* Markdown in Sidebar Chat */
.chat-messages-modern pre {
    background: #000 !important;
    padding: 15px !important;
    border-radius: 10px !important;
    margin: 15px 0 !important;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-messages-modern code {
    font-family: var(--font-code);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 5px;
    border-radius: 4px;
}
