/* --- Variables & Reset --- */
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;

    /* Technique Colors */
    --color-recon: #3b82f6;
    --color-sqli: #ef4444;
    --color-xss: #eab308;
    --color-auth: #10b981;
    --color-idor: #8b5cf6;
    --color-other: #64748b;
    --color-lfi: #f97316;
    --color-post: #ec4899;

    /* Model Colors */
    --model-claude: #8b5cf6;
    /* Violet */
    --model-gemini: #3b82f6;
    /* Blue */
    --model-codex: #10b981;
    /* Emerald */

    --font-sans: "Inter", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
}

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

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

/* --- Layout --- */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo h1 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.separator {
    width: 1px;
    height: 24px;
    background-color: var(--border);
    margin: 0 0.5rem;
}

.dashboard {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* --- Sidebar (Timeline) --- */
.sidebar {
    width: 280px;
    background-color: #111827;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition:
        width 0.3s ease,
        padding 0.3s ease,
        opacity 0.3s ease;
    overflow: hidden;
}

.sidebar.hidden {
    width: 0;
    padding: 0;
    opacity: 0;
    border-right: none;
}

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

.sidebar-header h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.timeline-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.timeline {
    list-style: none;
    position: relative;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
}

.timeline-item {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 1rem;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
}

.timeline-item:hover,
.timeline-item.active {
    opacity: 1;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -1.4rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background-color: var(--dot-color, var(--color-other));
    border: 2px solid var(--bg-dark);
    box-shadow: 0 0 0 1px var(--border);
}

.timeline-item.active::before {
    transform: scale(1.2);
    box-shadow: 0 0 8px var(--dot-color);
}

.timeline-item .step-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
}

.timeline-item .step-action {
    font-size: 0.85rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Content Area --- */
.content-area {
    flex: 1;
    overflow-y: auto;
    background-color: var(--bg-dark);
    padding: 1.5rem;
    position: relative;
}

.summary-view,
.detail-container,
.comparison-view {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.hidden {
    display: none !important;
}

/* Summary Header */
.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.summary-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    background-color: var(--bg-hover);
    color: var(--text-main);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-warning {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* --- Metrics Grid --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.metric-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.metric-card .val {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.5rem;
}

/* --- Charts --- */
.chart-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    min-height: 300px;
}

.chart-card h3 {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.chart-container {
    width: 100%;
    height: 350px;
}

/* --- Step Detail View --- */
.detail-container {
    background-color: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 0;
}

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

.step-label {
    font-size: 1.2rem;
    font-weight: 700;
}

.step-technique-badge {
    background-color: var(--bg-hover);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.step-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.rationale-card p {
    font-size: 1rem;
    line-height: 1.6;
    color: #cbd5e1;
}

.key-value-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.key-value-grid dt {
    color: var(--text-muted);
}

.key-value-grid dd {
    font-family: var(--font-mono);
    word-break: break-all;
}

.tags-section h4 {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.raw-card pre {
    background-color: #0b1120;
    padding: 1rem;
    border-radius: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: #cbd5e1;
    white-space: pre-wrap;
}

/* --- Comparison Table --- */
.comparison-table-container {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.comparison-table th {
    background-color: rgba(30, 41, 59, 1);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.comparison-table td {
    vertical-align: top;
}

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

/* Utilities */
.mb-4 {
    margin-bottom: 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn.primary {
    background-color: var(--text-main);
    color: var(--bg-dark);
}

.btn.primary:hover {
    background-color: #fff;
    transform: translateY(-1px);
}

.btn.secondary {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn.secondary:hover {
    border-color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.05);
}

.model-select {
    padding: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 6px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
