/* Header Analyser - Tool-specific styles */

.nav-actions { display: none; gap: var(--space-sm); }

@media (max-width: 600px) {
    .nav-actions button span { display: none; }
    .nav-actions button { padding: var(--space-sm); }
}

.nav-btn {
    padding: var(--space-sm) var(--space-md) !important;
    font-size: var(--text-sm) !important;
    border-radius: var(--radius-xl) !important;
    cursor: pointer;
    font-weight: 600 !important;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-btn-secondary {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
}

.nav-btn-secondary:hover {
    border-color: var(--border-active) !important;
    color: var(--primary) !important;
    background: var(--primary-glow) !important;
    box-shadow: none !important;
}

/* Input Section */
.input-section {
    background: var(--bg-secondary);
    padding: var(--space-2xl);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-2xl);
    animation: slideDown 0.5s ease-out;
    text-align: left;
    transition: border var(--transition-fast), background-color var(--transition-fast);
}

.input-section.drag-over {
    border: 2px dashed var(--primary);
    background-color: var(--primary-glow);
}

.input-section .btn {
    width: 100%;
    padding: 0.75rem var(--space-2xl);
}

/* Results Section */
#results { display: none; }

.dashboard {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

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

.card {
    text-align: left;
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

/* Score Circle */
.score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.score-circle { width: 120px; height: 120px; margin-bottom: var(--space-md); position: relative; flex-shrink: 0; }

.circular-chart { display: block; margin: 0 auto; max-width: 100%; max-height: 100%; }
.circle-bg { fill: none; stroke: var(--border-color); stroke-width: 2.5; }
.circle { fill: none; stroke-width: 2.5; stroke-linecap: round; transition: stroke-dasharray 1s ease-out, stroke 0.3s; }
.percentage { fill: var(--text-primary); font-family: 'Inter', sans-serif; font-weight: bold; font-size: 0.5em; text-anchor: middle; }

.score-label { font-size: var(--text-xs); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.score-verdict { font-weight: 800; margin-top: var(--space-sm); font-size: var(--text-lg); }

/* Risk Alert Box */
.risk-alert-box {
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    margin-bottom: var(--space-2xl);
    animation: fadeIn 0.5s ease-out;
}

.risk-title {
    color: var(--danger);
    margin-top: 0;
    margin-bottom: var(--space-md);
    font-size: var(--text-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Analysis Card */
.analysis-card { background: var(--bg-tertiary); }

.analysis-font, .detail-value, .hop-details {
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.detail-label { color: var(--primary); font-size: var(--text-sm); width: 100%; }

/* Details Table */
.detail-row {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.detail-row:last-child { border-bottom: none; }
.detail-label { width: 130px; font-weight: 600; flex-shrink: 0; }
.detail-value { word-break: break-all; line-height: 1.6; }

/* Badges */
.badge { margin-right: var(--space-sm); }
.badge-success { background: var(--success-bg); border: 1px solid rgba(52,211,153,0.2); color: var(--success); }
.badge-warning { background: var(--warning-bg); border: 1px solid rgba(251,191,36,0.2); color: var(--warning); }
.badge-danger { background: var(--danger-bg); border: 1px solid rgba(248,113,113,0.2); color: var(--danger); }
.badge-info { background: var(--info-bg); border: 1px solid rgba(34,211,238,0.2); color: var(--info); }
.badge-private { background: transparent; border: 1px solid var(--border-color); color: var(--text-tertiary); font-size: var(--text-xs); padding: 0.1rem 0.5rem; }

/* Raw Headers */
.raw-headers {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-xs);
    white-space: pre-wrap;
    color: var(--text-secondary);
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-primary);
    padding: var(--space-md);
    border-radius: var(--radius-xl);
    text-align: left;
    border: 1px solid var(--border-color);
}

.raw-badge-btn {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
    padding: var(--space-sm) var(--space-lg) !important;
    border-radius: var(--radius-full) !important;
    cursor: pointer;
    font-family: 'Inter', sans-serif !important;
    font-size: var(--text-sm) !important;
    box-shadow: none !important;
}

.raw-badge-btn:hover {
    border-color: var(--border-active) !important;
    color: var(--primary) !important;
    background: var(--primary-glow) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Timeline */
.timeline-wrapper { max-height: 350px; overflow-y: auto; padding-right: var(--space-sm); }

.timeline { position: relative; padding-left: 2rem; margin-top: var(--space-md); }

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.hop { position: relative; margin-bottom: var(--space-md); }

.hop-dot {
    position: absolute;
    left: -24px;
    top: 12px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border: 3px solid var(--bg-secondary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.hop-content {
    background: var(--bg-primary);
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    border: 1px solid var(--border-color);
}

.hop-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.hop-details { color: var(--text-secondary); font-size: var(--text-xs); word-break: break-all; line-height: 1.6; }
.hop-delay { font-size: var(--text-xs); margin-top: var(--space-sm); display: inline-block; padding: 2px 8px; background: var(--bg-tertiary); border-radius: var(--radius-lg); border: 1px solid var(--border-color); }

/* Scrollbar */
.timeline-wrapper::-webkit-scrollbar { width: 6px; }
.timeline-wrapper::-webkit-scrollbar-track { background: transparent; }
.timeline-wrapper::-webkit-scrollbar-thumb { background-color: var(--border-color); border-radius: 20px; }

.auth-details { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: var(--space-xs); word-break: break-word; line-height: 1.4; }

/* All Headers List */
.header-list-row {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: var(--space-md);
    padding: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    font-size: var(--text-sm);
    align-items: start;
    transition: background-color var(--transition-fast);
}

.header-list-row:nth-child(even) { background-color: rgba(255,255,255,0.02); }
.header-list-row:hover { background-color: rgba(129,140,248,0.05); }

.header-list-key { font-weight: 600; color: var(--primary); word-break: break-word; overflow-wrap: break-word; }

.header-list-value {
    overflow-wrap: anywhere;
    word-break: normal;
    white-space: pre-wrap;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    line-height: 1.5;
    font-size: var(--text-xs);
}

@media (max-width: 600px) {
    .header-list-row { grid-template-columns: 1fr; gap: var(--space-sm); }
    .header-list-key { font-size: var(--text-xs); opacity: 0.9; }
}

/* Tooltip */
.tooltip-trigger { position: relative; cursor: help; }

.tooltip-content {
    visibility: hidden;
    width: 200px;
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    text-align: center;
    border-radius: var(--radius-lg);
    padding: var(--space-sm) var(--space-md);
    position: absolute;
    z-index: 10;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    font-size: var(--text-xs);
    font-weight: normal;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--bg-elevated) transparent transparent transparent;
}

.tooltip-trigger:hover .tooltip-content { visibility: visible; opacity: 1; }

/* Footnotes */
.analysis-footnote {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-align: left;
    line-height: 1.6;
}

sup { color: var(--primary); font-weight: bold; line-height: 0; font-size: 0.9em; }

/* Print Styles */
@media print {
    .input-section, .nav-right, .theme-toggle { display: none !important; }
    body { background: white; color: black; }
    .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; margin-bottom: 1rem; }
    main { width: 100%; max-width: none; margin: 0; padding: 0; }
    .raw-headers { max-height: none; overflow: visible; }
    .timeline-wrapper { max-height: none; overflow: visible; }
}
