/*
 * ActProof.ai Dashboard - Modern CSS
 * Interactive GitHub Repository Scanner
 */

/* ============================================
   CSS Reset & Variables
   ============================================ */

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

:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Dark Theme Neutrals (Default) */
    --gray-50: #0a0a0a;
    --gray-100: #141414;
    --gray-200: #1f1f1f;
    --gray-300: #2a2a2a;
    --gray-400: #3a3a3a;
    --gray-500: #525252;
    --gray-600: #717171;
    --gray-700: #a3a3a3;
    --gray-800: #d4d4d4;
    --gray-900: #f5f5f5;

    /* Semantic Colors - Dark Mode (Default) */
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1f1f1f;
    --text-primary: #f5f5f5;
    --text-secondary: #d4d4d4;
    --text-tertiary: #a3a3a3;
    --border-primary: #3a3a3a;
    --border-secondary: #2a2a2a;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Shadows - Dark Mode */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 0 20px -5px rgba(99, 102, 241, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 0 30px -5px rgba(99, 102, 241, 0.15);

    /* Transitions */
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme (optional, for theme toggle) */
[data-theme="light"] {
    /* Grays - Light Mode */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Semantic Colors - Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;

    /* Shadows - Light Mode */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Base Styles
   ============================================ */

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
    overflow-x: hidden;
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.navbar .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-logo {
    height: 32px;
    width: auto;
}

.navbar-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.theme-toggle:hover {
    background: var(--gray-300);
    border-color: var(--primary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: transform 0.3s ease, color 0.3s ease;
}

.theme-toggle:hover svg {
    color: var(--primary);
    transform: rotate(180deg);
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

/* User Menu */
.user-menu {
    position: relative;
}

.btn-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-user:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-user svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Animated Background Logos
   ============================================ */

.animated-logos-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-logo {
    position: absolute;
    width: 25px;
    height: 25px;
    margin-left: -12.5px;
    margin-top: -12.5px;
    opacity: 0.5;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.9)) 
            drop-shadow(0 0 20px rgba(99, 102, 241, 0.7))
            drop-shadow(0 0 30px rgba(139, 92, 246, 0.5))
            drop-shadow(0 0 40px rgba(236, 72, 153, 0.4));
    animation: floatLogo var(--duration, 50s) var(--delay, 0s) infinite ease-in-out;
    will-change: left, top, transform;
}

.floating-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(1.7) contrast(1.4);
    animation: spinLogo var(--duration, 50s) var(--delay, 0s) infinite linear;
    transform-origin: center center;
}

@keyframes floatLogo {
    0% {
        left: var(--start-x, 0%);
        top: var(--start-y, 0%);
        transform: scale(0.9);
        opacity: 0.5;
    }
    25% {
        left: var(--mid-x-1, 50%);
        top: var(--mid-y-1, 50%);
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        left: var(--end-x, 100%);
        top: var(--end-y, 100%);
        transform: scale(0.95);
        opacity: 0.6;
    }
    75% {
        left: var(--mid-x-2, 50%);
        top: var(--mid-y-2, 50%);
        transform: scale(1.05);
        opacity: 0.7;
    }
    100% {
        left: var(--start-x, 0%);
        top: var(--start-y, 0%);
        transform: scale(0.9);
        opacity: 0.5;
    }
}

@keyframes spinLogo {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    flex: 1;
    padding: 3rem 0;
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================
   Hero Section
   ============================================ */

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: transparent;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

.hero-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
}

/* ============================================
   Scan Section
   ============================================ */

.scan-section {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.scan-card {
    max-width: 800px;
    width: 100%;
}

@media (max-width: 1024px) {
    .scan-section {
        display: flex;
        justify-content: center;
    }
    
    .scan-card {
        max-width: 100%;
    }
}

.scan-card {
    background: var(--bg-primary);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.scan-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.scan-header p {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

/* ============================================
   Form Styles
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: var(--font-mono);
    transition: all var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-hint {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(147, 51, 234, 0.4) 50%, rgba(168, 85, 247, 0.35) 100%);
    color: white;
    border: 1px solid rgba(168, 85, 247, 0.6);
    box-shadow: 0 4px 14px 0 rgba(168, 85, 247, 0.25);
    transition: all 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.45) 0%, rgba(139, 92, 246, 0.5) 50%, rgba(147, 51, 234, 0.45) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(168, 85, 247, 0.35);
    border-color: rgba(168, 85, 247, 0.7);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(147, 51, 234, 0.3) 50%, rgba(168, 85, 247, 0.25) 100%);
}

/* Scanning animation */
.btn-primary.scanning {
    position: relative;
    animation: scanningPulse 2s ease-in-out infinite;
    overflow: hidden;
}

.btn-primary.scanning::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: scanningShimmer 2s ease-in-out infinite;
}

@keyframes scanningPulse {
    0%, 100% {
        box-shadow: 0 4px 14px 0 rgba(168, 85, 247, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 20px 0 rgba(168, 85, 247, 0.7);
        transform: scale(1.02);
    }
}

@keyframes scanningShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.btn-secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4291 100%);
    box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.6);
    transform: translateY(-2px);
}

.btn-lg {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Hide button loader on scan button specifically - use bottom progress indicator instead */
#scanButton .btn-loader {
    display: none !important;
    visibility: hidden !important;
}

.spinner {
    animation: spin 1s linear infinite;
}

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

/* Scanning progress indicator */
.scanning-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    margin-top: 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(147, 51, 234, 0.4) 50%, rgba(168, 85, 247, 0.35) 100%);
    border-radius: 0.75rem;
    border: 1px solid rgba(168, 85, 247, 0.6);
    animation: fadeIn 0.3s ease-out;
    box-shadow: 0 4px 14px 0 rgba(168, 85, 247, 0.25);
    width: 100%;
}

.scanning-progress.hidden {
    display: none;
}

.scanning-progress-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.scanning-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 100%);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.8);
    animation: scanningDot 1.4s ease-in-out infinite;
}

.scanning-progress-dot:nth-child(1) {
    animation-delay: 0s;
}

.scanning-progress-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.scanning-progress-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes scanningDot {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.5);
        opacity: 1;
    }
}

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

.hidden {
    display: none !important;
}

/* ============================================
   Badge
   ============================================ */

.badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ============================================
   Examples Card
   ============================================ */

.examples-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.examples-card p {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.example-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.example-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    width: 100%;
}

.example-item:hover {
    background: var(--gray-100);
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================
   Status Messages
   ============================================ */

.status-message {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-top: 1rem;
    font-weight: 500;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

.status-message.info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* ============================================
   Results Section
   ============================================ */

.results-section {
    background: var(--bg-primary);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-primary);
    animation: slideUp 0.3s ease-out;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.btn-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 0.5rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-close:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.summary-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: 1rem;
    border: 1px solid var(--gray-200);
}

.summary-icon {
    font-size: 2.5rem;
}

.summary-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.summary-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* ============================================
   Tabs
   ============================================ */

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-400);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn:hover:not(.active) {
    color: var(--gray-900);
}

.tab-pane {
    display: none;
}

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

.code-block {
    background: var(--gray-100);
    border-radius: 0.75rem;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-400);
}

.code-block pre {
    background: transparent;
    margin: 0;
    padding: 0;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--gray-800);
    background: transparent;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background: var(--gray-50);
    color: var(--gray-600);
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid var(--gray-400);
}

.footer p {
    font-size: 0.875rem;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--primary-light);
}

/* Analytics and Docs Sections */
.analytics-section,
.docs-section {
    margin: 3rem 0;
    padding: 2rem 0;
}

.analytics-card,
.docs-card {
    background: var(--gray-100);
    border-radius: 12px;
    padding: 2.5rem;
    border: 1px solid var(--gray-400);
    box-shadow: var(--shadow-lg);
}

.analytics-card h2,
.docs-card h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.analytics-card p,
.docs-card p {
    color: var(--gray-700);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

.analytics-placeholder,
.docs-placeholder {
    text-align: center;
    padding: 3rem 2rem;
}

.analytics-placeholder .placeholder-icon,
.docs-placeholder .placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.analytics-placeholder h3,
.docs-placeholder h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.analytics-placeholder p,
.docs-placeholder p {
    color: var(--gray-700);
    margin-bottom: 2rem;
}

.docs-content {
    margin-top: 2rem;
}

/* ============================================
   Compliance Section
   ============================================ */

.compliance-placeholder {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-600);
}

.compliance-placeholder .placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.compliance-placeholder h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.compliance-placeholder p {
    margin-bottom: 2rem;
    color: var(--gray-600);
}

.compliance-results {
    padding: 1.5rem 0;
}

.compliance-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.compliance-score {
    flex: 1;
    min-width: 200px;
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    border: 2px solid;
}

.compliance-score.compliant {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.compliance-score.non-compliant {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.score-label {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.score-status {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.risk-badge {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.risk-badge.risk-low {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.risk-badge.risk-medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.risk-badge.risk-high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.compliance-requirements {
    margin-bottom: 2rem;
}

.compliance-requirements h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.requirements-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.requirement-item {
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--gray-400);
    background: var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.requirement-item.passed {
    background: rgba(16, 185, 129, 0.05);
    border-color: var(--success);
}

.requirement-item.failed {
    background: rgba(239, 68, 68, 0.05);
    border-color: var(--error);
}

.req-icon {
    font-size: 1.25rem;
}

.req-name {
    font-weight: 500;
    color: var(--gray-900);
}

.compliance-gaps,
.compliance-missing,
.compliance-recommendations {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 0.75rem;
    background: var(--gray-200);
    border: 1px solid var(--gray-400);
}

.compliance-gaps h3,
.compliance-missing h3,
.compliance-recommendations h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.gap-list,
.missing-list,
.recommendations-list {
    list-style: none;
    padding: 0;
}

.gap-list li,
.missing-list li,
.recommendations-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--gray-700);
}

.gap-list li::before {
    content: "⚠️";
    position: absolute;
    left: 0;
}

.missing-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--warning);
    font-weight: bold;
}

.recommendations-list li::before {
    content: "💡";
    position: absolute;
    left: 0;
}

/* ============================================
   RAG Query Section
   ============================================ */

.rag-section {
    padding: 1.5rem 0;
}

.rag-section h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.rag-description {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.rag-form {
    margin-bottom: 2rem;
}

.rag-form textarea {
    resize: vertical;
    min-height: 100px;
}

.rag-answer {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--gray-200);
    border-radius: 0.75rem;
    border: 1px solid var(--gray-400);
}

.rag-answer-content h4 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
}

.answer-text {
    padding: 1rem;
    background: var(--gray-200);
    border-radius: 0.5rem;
    color: var(--gray-800);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-400);
}

.rag-sources,
.rag-context {
    margin-top: 1.5rem;
}

.sources-list {
    list-style: none;
    padding: 0;
}

.sources-list li {
    padding: 0.75rem;
    background: var(--gray-200);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--gray-400);
}

.relevance-score {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
}

.context-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.context-item {
    padding: 1rem;
    background: var(--gray-200);
    border-radius: 0.5rem;
    border-left: 3px solid var(--primary);
    border: 1px solid var(--gray-400);
}

.context-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.context-item p {
    color: var(--gray-700);
    font-size: 0.875rem;
    line-height: 1.5;
}

.rag-error {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: 0.5rem;
    color: var(--error);
}

/* ============================================
   Scan History Section
   ============================================ */

.scan-history-section {
    margin-top: 3rem;
    padding: 2rem 0;
}

.history-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.history-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scans-table-container {
    overflow-x: auto;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.8) 0%, rgba(20, 20, 30, 0.9) 100%);
    border: 1.5px solid rgba(124, 58, 237, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.scans-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 1100px;
}

.scans-table colgroup {
    /* Define column widths */
}

.scans-table col:nth-child(1) { width: 22%; } /* Repository */
.scans-table col:nth-child(2) { width: 12%; } /* Status */
.scans-table col:nth-child(3) { width: 12%; } /* Date */
.scans-table col:nth-child(4) { width: 8%; } /* Duration */
.scans-table col:nth-child(5) { width: 18%; } /* Components */
.scans-table col:nth-child(6) { width: 11%; } /* Compliance */
.scans-table col:nth-child(7) { width: 10%; } /* Actions */

.scans-table thead {
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.8) 0%, rgba(15, 15, 25, 0.9) 100%);
}

.scans-table th {
    padding: 1.125rem 1.75rem;
    text-align: left;
    font-weight: 700;
    color: rgba(124, 58, 237, 0.8);
    border-bottom: 1.5px solid rgba(124, 58, 237, 0.15);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
}

.scans-table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scans-table th:hover::after {
    opacity: 0.5;
}

.scans-table tbody tr {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: transparent;
}

.scans-table tbody tr::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary) 0%, rgba(124, 58, 237, 0.5) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scans-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.1) 0%, rgba(124, 58, 237, 0.05) 50%, transparent 100%);
    transform: translateX(6px) scale(1.005);
    box-shadow: -3px 0 12px rgba(124, 58, 237, 0.3);
}

.scans-table tbody tr:hover::before {
    opacity: 1;
}

.scans-table tbody tr:not(:last-child) {
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
}

.scans-table tbody tr:last-child td {
    border-bottom: none;
}

.scans-table td {
    padding: 1.25rem 1.75rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scans-table td:nth-child(5) {
    white-space: normal;
}

/* Only hide first column on dashboard scans table, NOT history table */
.dashboard .scans-table th:nth-child(1),
.dashboard .scans-table td:nth-child(1),
.scans-table:not(.history-table) th:nth-child(1),
.scans-table:not(.history-table) td:nth-child(1) {
    overflow: hidden;
    max-width: 0;
}

/* Responsive table */
@media (max-width: 1200px) {
    .scans-table {
        table-layout: auto;
        min-width: 900px;
    }
}

@media (max-width: 768px) {
    .scans-table {
        min-width: 800px;
    }

    .scans-table th,
    .scans-table td {
        padding: 0.875rem 1rem;
        font-size: 0.8125rem;
    }
}

/* Repository Cell */
.repo-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.repo-cell svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.repo-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.repo-name {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.repo-url {
    font-size: 0.75rem;
    color: rgba(124, 58, 237, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
}

.repo-info strong {
    color: var(--text-primary);
    font-weight: 700;
}

.repo-info small {
    color: rgba(124, 58, 237, 0.5);
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Components Cell */
.components-cell {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    max-width: 100%;
    width: 100%;
}

.components-cell span {
    padding: 0.375rem 0.625rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(124, 58, 237, 0.08) 100%);
    border: 1.5px solid rgba(124, 58, 237, 0.25);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    line-height: 1.2;
    color: rgba(124, 58, 237, 0.9);
    position: relative;
    overflow: hidden;
}

.components-cell span::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.components-cell span:hover::before {
    left: 100%;
}

.components-cell span:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25) 0%, rgba(124, 58, 237, 0.15) 100%);
    border-color: rgba(124, 58, 237, 0.4);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Compliance Score in Table */
.compliance-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    white-space: nowrap;
    min-width: 65px;
}

.compliance-score:hover {
    transform: scale(1.05);
}

.compliance-score.score-high {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.compliance-score.score-medium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.1) 100%);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.compliance-score.score-low {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.1) 100%);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Action Buttons in Table */
.btn-icon {
    padding: 0.5rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(124, 58, 237, 0.05) 100%);
    border: 1.5px solid rgba(124, 58, 237, 0.2);
    border-radius: 10px;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-icon:hover::before {
    width: 120%;
    height: 120%;
}

.btn-icon:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(124, 58, 237, 0.1) 100%);
    border-color: var(--primary);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-icon svg {
    position: relative;
    z-index: 1;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-badge.status-cloning,
.status-badge.status-scanning,
.status-badge.status-analyzing {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.status-completed {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.status-failed {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.scan-summary {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.scan-summary span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-primary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-primary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 1rem auto;
}

/* ============================================
   User Dropdown Menu
   ============================================ */

.user-menu {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--card-bg, var(--bg-secondary));
    border: 1px solid var(--border, var(--border-primary));
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.user-dropdown.hidden {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9375rem;
}

.dropdown-item:hover {
    background: var(--bg-tertiary, var(--gray-200));
}

.dropdown-item svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}