/* ===== BASE STYLES ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

::selection {
    background: rgba(0, 212, 255, 0.2);
    color: white;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ===== NAVIGATION ===== */
.nav-glass {
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ===== GRID BACKGROUND ===== */
.grid-bg {
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes floatDelayed {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 20px); }
}

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

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0); }
    50% { box-shadow: 0 0 20px 5px rgba(0, 212, 255, 0.1); }
}

@keyframes checkmarkDraw {
    from { stroke-dashoffset: 20; }
    to { stroke-dashoffset: 0; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

.animate-fade-in { animation: fadeIn 0.6s ease-out both; }
.animate-fade-in-up { animation: fadeInUp 0.6s ease-out both; }
.animate-fade-in-scale { animation: fadeInScale 0.4s ease-out both; }
.animate-float { animation: float 8s ease-in-out infinite; }
.animate-float-delayed { animation: floatDelayed 10s ease-in-out infinite; }
.animate-slide-in-left { animation: slideInFromLeft 0.4s ease-out both; }

.pulse-dot {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ===== PROGRESS SOURCE ITEMS ===== */
.source-item {
    transition: all 0.3s ease;
}

.source-item.active {
    background: rgba(0, 212, 255, 0.05);
    border-color: rgba(0, 212, 255, 0.15);
}

.source-item.completed .source-check {
    color: #10b981;
}

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

.source-item .check-icon {
    animation: fadeInScale 0.3s ease-out both;
}

/* Shimmer loading effect */
.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ===== REPORT SECTION STYLES ===== */
.report-section {
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(13, 18, 36, 0.5);
}

.report-section:hover {
    border-color: rgba(255,255,255,0.1);
}

.report-section-header {
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: background 0.2s ease;
}

.report-section-header:hover {
    background: rgba(255,255,255,0.02);
}

.report-section-header .chevron {
    transition: transform 0.3s ease;
    color: rgba(255,255,255,0.3);
}

.report-section.open .report-section-header .chevron {
    transform: rotate(180deg);
}

.report-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.report-section.open .report-section-body {
    max-height: 5000px;
}

.report-section-content {
    padding: 0 24px 24px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 20px;
}

/* ===== SIDEBAR NAV ===== */
.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.sidebar-nav-item:hover {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.03);
}

.sidebar-nav-item.active {
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.05);
}

.sidebar-nav-item .nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
    flex-shrink: 0;
}

/* ===== DATA TABLE STYLES ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    padding: 10px 16px;
    font-weight: 500;
    color: rgba(255,255,255,0.35);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.data-table td {
    padding: 10px 16px;
    color: rgba(255,255,255,0.7);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.data-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* ===== RED FLAG BADGE ===== */
.red-flag {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
    margin-bottom: 12px;
}

.red-flag:last-child { margin-bottom: 0; }

.red-flag-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== SOURCE CITATION ===== */
.source-citation {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(99, 102, 241, 0.1);
    color: rgba(99, 102, 241, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.15);
    text-decoration: none;
    transition: all 0.2s;
}

.source-citation:hover {
    background: rgba(99, 102, 241, 0.15);
    color: rgba(99, 102, 241, 0.9);
}

/* ===== DATA SOURCE CARDS ===== */
.source-card {
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(13, 18, 36, 0.5);
    transition: all 0.3s ease;
}

.source-card:hover {
    border-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

/* ===== CHART CONTAINER ===== */
.chart-container {
    position: relative;
    padding: 16px;
    border-radius: 12px;
    background: rgba(17, 24, 48, 0.5);
    border: 1px solid rgba(255,255,255,0.05);
}

/* ===== METRIC CARDS ===== */
.metric-card {
    padding: 16px;
    border-radius: 12px;
    background: rgba(17, 24, 48, 0.5);
    border: 1px solid rgba(255,255,255,0.05);
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: white;
    font-family: 'JetBrains Mono', monospace;
}

.metric-label {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* ===== TIMELINE ===== */
.timeline-item {
    position: relative;
    padding-left: 28px;
    padding-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 0;
    width: 1px;
    background: rgba(255,255,255,0.08);
}

.timeline-item:last-child::before { display: none; }

.timeline-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #111830;
    border: 2px solid rgba(0, 212, 255, 0.4);
}

/* ===== PRINT STYLES ===== */
@media print {
    body { background: white; color: black; }
    .nav-glass, #report-sidebar, #btn-download-pdf, #btn-download-pdf-mobile { display: none !important; }
    #page-container { padding-top: 0; }
    .report-section { border: 1px solid #ddd; break-inside: avoid; }
    .report-section-body { max-height: none !important; }
    .report-section-content { border-top: 1px solid #ddd; }
    .red-flag { background: #fff5f5; border-color: #fcc; }
    .source-citation { background: #f0f0ff; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .search-glow { display: none; }
}
