:root {
    /* Colors */
    --clr-background: #0f172a; /* Slate 900 */
    --clr-surface: #1e293b; /* Slate 800 */
    --clr-surface-highlight: #334155; /* Slate 700 */
    --clr-border: #334155;
    
    --clr-text-primary: #f8fafc; /* Slate 50 */
    --clr-text-secondary: #94a3b8; /* Slate 400 */
    --clr-text-muted: #64748b; /* Slate 500 */
    
    --clr-primary: #3b82f6; /* Blue 500 */
    --clr-primary-hover: #2563eb; /* Blue 600 */
    --clr-primary-transparent: rgba(59, 130, 246, 0.15);
    
    --clr-success: #10b981; /* Emerald 500 */
    --clr-success-bg: rgba(16, 185, 129, 0.1);
    --clr-warning: #f59e0b; /* Amber 500 */
    --clr-warning-bg: rgba(245, 158, 11, 0.1);
    --clr-danger: #ef4444; /* Red 500 */
    --clr-danger-bg: rgba(239, 68, 68, 0.1);
    --clr-info: #0ea5e9; /* Sky 500 */
    --clr-info-bg: rgba(14, 165, 233, 0.1);
    
    /* Typography */
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', 'JetBrains Mono', monospace;
    
    /* Metrics */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.25s ease-in-out;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 15px var(--clr-primary-transparent);
}

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

body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    background-color: var(--clr-background);
    color: var(--clr-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100vh;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Base Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    outline: none;
    white-space: nowrap;
}

.btn i {
    width: 16px;
    height: 16px;
}

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

.btn-primary {
    background-color: var(--clr-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--clr-primary-hover);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-secondary {
    background-color: var(--clr-surface);
    color: var(--clr-text-primary);
    border-color: var(--clr-border);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--clr-surface-highlight);
    border-color: var(--clr-text-muted);
}

.btn-icon {
    padding: 6px;
    background: transparent;
    color: var(--clr-text-secondary);
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
}

.btn-icon:hover:not(:disabled) {
    background-color: var(--clr-surface-highlight);
    color: var(--clr-text-primary);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
    background-color: var(--clr-surface-highlight);
    color: var(--clr-text-secondary);
}

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

/* Header */
.app-header {
    background-color: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    padding: 0 24px;
    height: 64px;
    flex-shrink: 0;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--clr-primary);
}

.logo i {
    width: 24px;
    height: 24px;
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--clr-text-primary);
    letter-spacing: -0.025em;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Main Content & Split View */
.main-content {
    flex: 1;
    overflow: hidden;
    padding: 24px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

.split-view {
    display: flex;
    gap: 24px;
    height: 100%;
}

@media (max-width: 900px) {
    .split-view {
        flex-direction: column;
    }
}

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--clr-border);
    background-color: rgba(15, 23, 42, 0.3);
}

.panel-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--clr-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Input Panel */
.editor-container {
    flex: 1;
    position: relative;
    padding: 16px;
    background-color: #0d1117; /* Darker background for code */
}

.code-editor {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--clr-text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    resize: none;
}

.code-editor::placeholder {
    color: var(--clr-text-muted);
}

/* Output Panel */
.results-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: var(--clr-background);
}

.results-container::-webkit-scrollbar {
    width: 8px;
}
.results-container::-webkit-scrollbar-track {
    background: transparent;
}
.results-container::-webkit-scrollbar-thumb {
    background-color: var(--clr-surface-highlight);
    border-radius: 4px;
}

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

.empty-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--clr-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border: 1px solid var(--clr-border);
}

.empty-icon-wrapper i {
    width: 32px;
    height: 32px;
    color: var(--clr-text-secondary);
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--clr-text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    max-width: 300px;
    font-size: 14px;
}

/* Analysis Content */
.analysis-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.result-section {
    background-color: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid var(--clr-border);
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--clr-text-primary);
}

.section-header h3 i {
    width: 16px;
    height: 16px;
    color: var(--clr-primary);
}

/* Security Section */
.score-badge {
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    font-size: 12px;
}

.score-a { background-color: var(--clr-success-bg); color: var(--clr-success); border: 1px solid rgba(16, 185, 129, 0.2); }
.score-b { background-color: var(--clr-info-bg); color: var(--clr-info); border: 1px solid rgba(14, 165, 233, 0.2); }
.score-c { background-color: var(--clr-warning-bg); color: var(--clr-warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.score-f { background-color: var(--clr-danger-bg); color: var(--clr-danger); border: 1px solid rgba(239, 68, 68, 0.2); }

.security-alerts {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    background-color: var(--clr-background);
    border-left: 3px solid transparent;
}

.alert-success { border-left-color: var(--clr-success); }
.alert-warning { border-left-color: var(--clr-warning); }
.alert-danger { border-left-color: var(--clr-danger); }

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert-success .alert-icon { color: var(--clr-success); }
.alert-warning .alert-icon { color: var(--clr-warning); }
.alert-danger .alert-icon { color: var(--clr-danger); }

.alert-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.alert-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--clr-text-primary);
    font-family: var(--font-mono);
}

.alert-desc {
    font-size: 12px;
    color: var(--clr-text-secondary);
}

/* Parsed Headers Section */
.search-box {
    display: flex;
    align-items: center;
    background-color: var(--clr-background);
    border: 1px solid var(--clr-border);
    border-radius: var(--border-radius-sm);
    padding: 4px 8px;
    width: 200px;
}

.search-box i {
    width: 14px;
    height: 14px;
    color: var(--clr-text-muted);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--clr-text-primary);
    font-size: 12px;
    padding-left: 6px;
    width: 100%;
}

.headers-wrapper {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.header-category {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--clr-border);
}

.header-item {
    display: flex;
    flex-direction: column;
    background-color: var(--clr-background);
    border: 1px solid var(--clr-border);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.header-key {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--clr-info);
    padding: 6px 10px;
    background-color: rgba(15, 23, 42, 0.4);
    border-bottom: 1px solid var(--clr-border);
    word-break: break-all;
}

.header-value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--clr-text-primary);
    padding: 8px 10px;
    word-break: break-all;
    white-space: pre-wrap;
}

/* Status Line */
.status-line {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    padding: 12px 16px;
    background-color: var(--clr-primary-transparent);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--border-radius-md);
    color: var(--clr-text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--clr-surface);
    border: 1px solid var(--clr-border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius-md);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    color: var(--clr-success);
    width: 20px;
    height: 20px;
}

.toast-message {
    font-weight: 500;
    color: var(--clr-text-primary);
}
