@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #080710;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.3);
    --secondary: #06b6d4;
    --secondary-glow: rgba(6, 182, 212, 0.3);
    --accent: #ec4899;
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);
    
    --gold: #f59e0b;
    --silver: #94a3b8;
    --bronze: #b45309;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Stunning Dynamic Background */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
    animation: pulseGlow 15s infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
    animation: pulseGlow 20s infinite alternate-reverse;
}

@keyframes pulseGlow {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.2) translate(10%, 10%); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* Header & Glassmorphism Title */
header {
    margin-bottom: 2.5rem;
    text-align: center;
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.title-container {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.title-container span {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 30%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

.subtitle strong {
    color: #ffffff;
    border-bottom: 2px solid var(--primary);
}

/* KPI Dashboard Cards (Without Icons) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    padding: 1.6rem 1.8rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.5rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.kpi-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.15);
}

.kpi-info h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.kpi-info p {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 40%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.kpi-card:nth-child(1) .kpi-info p { background: linear-gradient(135deg, #ffffff, var(--primary)); -webkit-background-clip: text; }
.kpi-card:nth-child(2) .kpi-info p { background: linear-gradient(135deg, #ffffff, var(--secondary)); -webkit-background-clip: text; }
.kpi-card:nth-child(3) .kpi-info p { background: linear-gradient(135deg, #ffffff, var(--accent)); -webkit-background-clip: text; }
.kpi-card:nth-child(4) .kpi-info p { background: linear-gradient(135deg, #ffffff, var(--success)); -webkit-background-clip: text; }

/* Tabs Design */
.tabs-nav {
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.4rem;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    max-width: fit-content;
    margin: 0 auto;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.7rem 1.3rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 4px 10px rgba(0,0,0,0.2);
}

.tab-btn:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
}

/* Action Control Bar */
.controls-bar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    padding: 1.2rem 1.5rem;
    border-radius: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    border-radius: 14px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
    background: rgba(255, 255, 255, 0.07);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 1.1rem;
}

.action-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.4rem;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.5);
    filter: brightness(1.1);
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    animation: fadeIn 0.5s ease 0.3s both;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

/* Beautiful Result Card */
.result-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 1.8rem;
    display: flex;
    gap: 1.5rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: background 0.3s ease;
}

.result-card:hover {
    transform: translateY(-3px) scale(1.002);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.result-card:hover::before {
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
}

/* Rank Badges */
.rank-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rank-badge {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.result-card[data-rank="1"] .rank-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.2));
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

.result-card[data-rank="2"] .rank-badge {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(100, 116, 139, 0.2));
    border-color: var(--silver);
    color: var(--silver);
}

.result-card[data-rank="3"] .rank-badge {
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.2), rgba(146, 64, 14, 0.2));
    border-color: var(--bronze);
    color: var(--bronze);
}

/* Card Content Details */
.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-title:hover {
    color: var(--secondary);
}

/* URL and copy styling */
.url-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    max-width: fit-content;
}

.url-link {
    color: var(--secondary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 450px;
    font-weight: 500;
}

.url-link:hover {
    text-decoration: underline;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.1s ease;
}

.copy-btn:hover {
    color: #ffffff;
    transform: scale(1.15);
}

.copy-btn:active {
    transform: scale(0.9);
}

/* Snippet */
.card-snippet {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
}

/* Domain/Host Tag badge */
.domain-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Collapse Toggle Button */
.expand-toggle {
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.4rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.expand-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.expand-toggle svg {
    transition: transform 0.3s ease;
}

.expand-toggle.active svg {
    transform: rotate(180deg);
}

/* AI Analysis View Grid Layout (Spreadsheet style) - Collapsed by default */
.ai-analysis-block {
    display: none;
    margin-top: 1rem;
    padding-top: 1.2rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.2rem;
    animation: fadeIn 0.4s ease;
}

.ai-analysis-block.show {
    display: grid;
}

.ai-item {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 1rem;
    border-radius: 12px;
}

.ai-item-full {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 1rem;
    border-radius: 12px;
}

.ai-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ai-value {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.ai-value.category-theme {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-tag {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-tag.theme {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-tag.access-error {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.highlight-positive {
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid var(--success);
}

.highlight-negative {
    background: rgba(239, 68, 68, 0.05);
    border-left: 3px solid var(--danger);
}

.ai-timestamp {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    animation: fadeIn 0.5s ease;
}

.page-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.page-btn:hover:not(.active):not(:disabled) {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
}

.page-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-nav-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0.8rem;
}

/* Consolidated Report Design */
.report-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    line-height: 1.8;
}

.report-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.report-container h2 {
    font-family: 'Outfit', sans-serif;
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.4rem;
}

.report-container h2::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 1.2rem;
    background: var(--primary);
    margin-right: 0.8rem;
    border-radius: 3px;
}

.report-container p {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}

.report-container ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.report-container li {
    margin-bottom: 0.6rem;
}

.report-container strong {
    color: #ffffff;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: #ffffff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

/* Print Styling for clean PDF exports */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .container {
        padding: 0 !important;
        max-width: 100% !important;
    }
    
    .kpi-grid,
    .controls-bar,
    .tabs-nav,
    .results-header,
    .pagination-container,
    .back-to-top,
    .copy-btn,
    .expand-toggle {
        display: none !important;
    }
    
    .results-list {
        display: block !important;
        gap: 0 !important;
    }
    
    .result-card {
        page-break-inside: avoid !important;
        border: 1px solid #ddd !important;
        background: #fff !important;
        color: #000 !important;
        margin-bottom: 1.5rem !important;
        padding: 1.2rem !important;
        box-shadow: none !important;
    }
    
    .ai-analysis-block {
        display: grid !important; /* Force expand all items in print */
        border-color: #eee !important;
    }
    
    .ai-item, .ai-item-full {
        background: #fdfdfd !important;
        border: 1px solid #eee !important;
        color: #000 !important;
    }
    
    .card-title {
        color: #000 !important;
    }
    
    .url-link {
        color: #333 !important;
    }
    
    .badge-tag, .domain-badge {
        border: 1px solid #ccc !important;
        background: #f5f5f5 !important;
        color: #333 !important;
    }
    
    .report-container {
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
        padding: 0 !important;
        border: none !important;
    }
    
    .report-container h1, 
    .report-container h2, 
    .report-container strong {
        color: #000 !important;
    }
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive details */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .action-buttons {
        justify-content: stretch;
    }
    .btn {
        flex: 1;
        justify-content: center;
    }
    .result-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.2rem;
    }
    .rank-badge {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .url-link {
        max-width: 220px;
    }
    .report-container {
        padding: 1.5rem;
    }
}

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

/* Custom Badges & Header elements */
.header-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.time-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.report-timestamp-badge {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Theme Toggle Button Style */
.theme-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Light Theme Variable Overrides */
body.light-theme {
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.06);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --primary: #6d28d9;
    --secondary: #0891b2;
    --accent: #db2777;
    --primary-glow: rgba(109, 40, 217, 0.05);
    --secondary-glow: rgba(8, 145, 178, 0.05);
}

body.light-theme h1 {
    background: linear-gradient(135deg, #1e293b 30%, #6d28d9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .subtitle strong {
    color: #0f172a;
}

body.light-theme .result-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

body.light-theme .result-card:hover {
    box-shadow: 0 10px 30px rgba(109, 40, 217, 0.07);
    border-color: rgba(109, 40, 217, 0.15);
}

body.light-theme .rank-badge {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
    color: #0f172a;
}

body.light-theme .card-title {
    color: #0f172a;
}

body.light-theme .card-title:hover {
    color: var(--primary);
}

body.light-theme .url-bar {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-theme .expand-toggle {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

body.light-theme .expand-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.light-theme .ai-analysis-block {
    border-top-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .ai-item,
body.light-theme .ai-item-full {
    background: rgba(0, 0, 0, 0.008);
    border-color: rgba(0, 0, 0, 0.03);
}

body.light-theme .time-badge {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

body.light-theme .report-timestamp-badge {
    background: rgba(109, 40, 217, 0.06);
    border-color: rgba(109, 40, 217, 0.12);
    color: #6d28d9;
}

body.light-theme .badge-tag {
    background: rgba(109, 40, 217, 0.08);
    color: #6d28d9;
    border-color: rgba(109, 40, 217, 0.15);
}

body.light-theme .badge-tag.theme {
    background: rgba(8, 145, 178, 0.08);
    color: #0891b2;
    border-color: rgba(8, 145, 178, 0.15);
}

body.light-theme .badge-tag.access-error {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-secondary);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .copy-btn:hover {
    color: var(--primary);
}

body.light-theme .page-btn {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

body.light-theme .page-btn:hover:not(.active):not(:disabled) {
    background: #f1f5f9;
}

body.light-theme .tab-btn.active {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

body.light-theme .tab-btn:hover:not(.active) {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.02);
}

body.light-theme .search-input {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

body.light-theme .search-input:focus {
    background: #ffffff;
    border-color: var(--primary);
}

body.light-theme .title-container {
    background: rgba(0, 0, 0, 0.02);
}

body.light-theme .report-container {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

body.light-theme .report-container strong {
    color: #0f172a;
}

body.light-theme .report-container h2 {
    color: #0f172a;
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .report-container h2::before {
    background: var(--primary);
}

body.light-theme .theme-toggle {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

body.light-theme .theme-toggle:hover {
    border-color: rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }
}

/* Secondary sub-tabs inside the Results tab (Resultados / Erros de Conexão/Acesso) */
.subtabs-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.6rem;
}

.subtab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.45rem 0.9rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: all 0.25s ease;
}

.subtab-btn:hover:not(.active) {
    color: #ffffff;
    opacity: 1;
    background: rgba(255, 255, 255, 0.03);
}

.subtab-btn.active {
    color: #ffffff;
    opacity: 1;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

body.light-theme .subtab-btn.active {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .subtab-btn:hover:not(.active) {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.02);
}

/* Analysis Control Panel Styling */
.analysis-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 1.5rem 1.8rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.01em;
}

body.light-theme .panel-header h2 {
    color: #0f172a;
}

.panel-buttons {
    display: flex;
    gap: 0.8rem;
}

.btn-run {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-run:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    filter: brightness(1.1);
}

.btn-run:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-clear {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
}

.btn-clear:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Progress bar styling */
.progress-bar-wrapper {
    margin: 1.5rem 0;
    background: rgba(0, 0, 0, 0.15);
    padding: 1.2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

body.light-theme .progress-bar-wrapper {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.04);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

body.light-theme .progress-bar-bg {
    background: rgba(0, 0, 0, 0.05);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Loading spinner and wait text */
.spinner-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

body.light-theme .spinner {
    border-color: rgba(0, 0, 0, 0.05);
    border-top-color: var(--primary);
}

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

/* Logs console styling */
.logs-console {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
    padding-top: 1rem;
}

body.light-theme .logs-console {
    border-top-color: rgba(0, 0, 0, 0.06);
}

.logs-console summary {
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    outline: none;
}

.logs-console summary:hover {
    color: var(--text-primary);
}

.logs-content {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.04);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 1rem;
    border-radius: 12px;
    margin-top: 0.6rem;
    max-height: 180px;
    overflow-y: auto;
    color: #34d399; /* terminal green */
    line-height: 1.5;
}

/* Query Switcher & Configuration panel */
.query-config-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1.5rem;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 250px;
}

.config-group.new-query-group {
    flex: 2;
}

.config-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-select, .form-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.7rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

body.light-theme .form-select, body.light-theme .form-input {
    background: #ffffff;
    color: #0f172a;
}

body.light-theme .form-select option {
    background: #ffffff;
    color: #0f172a;
}

.form-select option {
    background: #1e1b4b;
    color: #ffffff;
}

.form-select:focus, .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.new-query-controls {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.new-query-controls .form-input {
    flex: 1;
}

.new-query-controls .limit-select {
    width: 140px;
    min-width: 140px;
}

@media (max-width: 768px) {
    .query-config-row {
        flex-direction: column;
        align-items: stretch;
    }
    .new-query-controls {
        flex-wrap: wrap;
    }
    .new-query-controls .btn-run {
        width: 100%;
    }
}

body.light-theme .logs-content {
    background: #1e293b;
    border-color: transparent;
}


