/* styles.css — Minimal clean styling for PCAP Analyzer MVP */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    background: #f5f5f5;
    line-height: 1.5;
}

/* --- Header --- */
.header {
    background: #1a73e8;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header .filename {
    font-size: 13px;
    opacity: 0.9;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    background: #fff;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 24px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: #1a73e8;
}

.tab-btn.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- Drop Zone --- */
.drop-zone {
    margin: 24px auto;
    max-width: 600px;
    background: #fff;
    border: 2px dashed #ccc;
    border-radius: 8px;
    text-align: center;
    padding: 48px 24px;
    transition: border-color 0.2s, background-color 0.2s;
}

.drop-zone.drag-over {
    border-color: #1a73e8;
    background: #e8f0fe;
}

.drop-zone.has-file {
    padding: 12px 24px;
    max-width: none;
    border: none;
    margin: 0;
    background: transparent;
}

.drop-zone.has-file .drop-zone-content {
    display: none;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.drop-zone-main-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.drop-zone-sub-text {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}

.browse-btn {
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 12px;
}

.browse-btn:hover {
    background: #1557b0;
}

.drop-zone-hint {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
}

/* --- Error --- */
.error-message {
    background: #fce8e8;
    color: #c62828;
    padding: 12px 24px;
    margin: 8px 24px;
    border-radius: 4px;
    font-size: 13px;
}

/* --- Summary Panel --- */
.summary-panel {
    background: #fff;
    margin: 16px 24px;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-item {
    text-align: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #1a73e8;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* --- Finding Badges --- */
.finding-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-critical {
    background: #fce8e8;
    color: #c62828;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.badge-info {
    background: #e8f0fe;
    color: #1a73e8;
}

.badge-clean {
    background: #e8f5e9;
    color: #2e7d32;
}

/* --- Findings List --- */
.findings-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.finding-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.finding-row:hover {
    filter: brightness(0.97);
}

.finding-critical {
    background: #fce8e8;
}

.finding-warning {
    background: #fff3e0;
}

.finding-info {
    background: #e8f0fe;
}

.finding-severity {
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
    min-width: 70px;
}

.finding-title {
    font-weight: 600;
    white-space: nowrap;
}

.finding-desc {
    color: #555;
}

/* --- Section Header --- */
.section-header {
    padding: 8px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #555;
    text-transform: uppercase;
}

/* --- Tables --- */
.sessions-container,
.packets-container {
    background: #fff;
    margin: 16px 24px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 50vh;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

th {
    background: #f8f9fa;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable:hover {
    background: #eef1f5;
}

.sort-indicator {
    font-size: 11px;
    color: #1a73e8;
    font-weight: 700;
}

td {
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

.number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

tbody tr:hover {
    background: #f5f8ff;
}

tbody tr.selected {
    background: #e8f0fe;
}

/* Handshake state colors */
.hs-complete { color: #2e7d32; }
.hs-partial { color: #e65100; }
.hs-failed { color: #c62828; font-weight: 600; }
.hs-none { color: #888; }

/* Teardown state colors */
.td-fin-clean { color: #2e7d32; }
.td-rst-after-fin { color: #c62828; font-weight: 600; }
.td-rst-abrupt { color: #c62828; }
.td-open { color: #888; }

/* Issues highlight */
.has-issue {
    color: #e65100;
    font-weight: 600;
}

/* Packet flag row colors */
.pkt-syn { background: #e8f5e9; }
.pkt-synack { background: #e8f0fe; }
.pkt-fin { background: #fff3e0; }
.pkt-rst { background: #fce8e8; }

.flags {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
}

/* --- Packet Filter Header --- */
.packet-filter-header {
    padding: 8px 16px;
    background: #e8f0fe;
    border-bottom: 1px solid #d0dff5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.packet-filter-header a {
    color: #1a73e8;
    text-decoration: none;
    font-size: 13px;
}

.packet-filter-header a:hover {
    text-decoration: underline;
}

/* --- PII Scrubber Tab --- */
.scrubber-container {
    margin: 24px;
}

.scrubber-panes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.scrubber-pane label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.scrubber-pane textarea {
    width: 100%;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    line-height: 1.5;
    background: #fff;
}

.scrubber-pane textarea[readonly] {
    background: #f8f9fa;
}

.scrubber-stats {
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
    min-height: 20px;
}

.scrubber-actions {
    display: flex;
    gap: 8px;
}

.scrubber-btn {
    padding: 8px 16px;
    border: 1px solid #1a73e8;
    background: #1a73e8;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.scrubber-btn:hover {
    background: #1557b0;
    border-color: #1557b0;
}

.scrubber-btn-reset {
    background: #fff;
    color: #c62828;
    border-color: #c62828;
}

.scrubber-btn-reset:hover {
    background: #fce8e8;
}

/* --- AI Assistance Tab --- */
.ai-container {
    margin: 24px;
}

.ai-controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.ai-template-picker,
.ai-session-picker {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.ai-container select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

.ai-container select:disabled {
    background: #f0f0f0;
    color: #999;
}

.ai-container textarea {
    width: 100%;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    line-height: 1.5;
    background: #fff;
}

.ai-container textarea[readonly] {
    background: #f8f9fa;
}

.ai-token-summary {
    font-size: 13px;
    color: #555;
    margin: 8px 0 12px;
    min-height: 20px;
}

.ai-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.ai-btn {
    padding: 8px 16px;
    border: 1px solid #1a73e8;
    background: #1a73e8;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ai-btn:hover {
    background: #1557b0;
    border-color: #1557b0;
}

.ai-btn-secondary {
    background: #fff;
    color: #1a73e8;
}

.ai-btn-secondary:hover {
    background: #e8f0fe;
}

.ai-restore-section {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
    margin-top: 8px;
}

.ai-restore-section .ai-btn {
    margin: 8px 0 12px;
}
