:root { 
    --primary: #3b82f6; /* Bright Blue */
    --primary-dark: #2563eb;
    --bg: #0f172a; /* Slate 900 */
    --surface: #1e293b; /* Slate 800 */
    --input-bg: #334155;
    --text-main: #f8fafc; /* Slate 50 */
    --text-muted: #94a3b8; /* Slate 400 */
    --border: #334155; /* Slate 700 */
    --success: #10b981; 
    --warning: #f59e0b; 
    --danger: #ef4444; 
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    --radius: 10px;
}


body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg); 
    color: var(--text-main);
    margin: 0; 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
    overflow: hidden; 
}

/* HEADER & NAV */
.header { 
    background: var(--surface); 
    border-bottom: none;
    padding: 10px 25px; 
    flex-shrink: 0; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 20;
}
.header .site-title { 
    margin: 0; 
    font-size: 20px; 
    font-weight: 800; 
    background: linear-gradient(135deg, #60a5fa 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}
.nav { 
    background: var(--surface); 
    padding: 0 25px; 
    border-bottom: 1px solid var(--border); 
    display: flex; 
    gap: 10px; 
    flex-shrink: 0; 
    box-shadow: var(--shadow-sm);
    z-index: 10;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-btn {
    background: transparent; border: none; padding: 10px 8px; cursor: pointer; margin: 8px 0;
    font-size: 12px; font-weight: 600; color: var(--text-muted); border-radius: 6px; outline: none;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-btn:hover { color: var(--primary); background: var(--bg); }
.nav-btn.active { background: var(--bg); color: var(--primary); border: 1px solid var(--border); }

/* CONTENT */
main { flex: 1; overflow: hidden; position: relative; }
.tab-content { display: none; height: 100%; width: 100%; }
.tab-content.active { display: flex; }

/* SPLIT SCREEN */
/* SEO: Use semantic class names but keep layout logic */
.split-left { width: 35%; min-width: 320px; padding: 30px; border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto; box-sizing: border-box; }
.split-right { width: 65%; padding: 20px; background: var(--bg); overflow-y: auto; box-sizing: border-box; }

/* TYPOGRAPHY */
h2 { font-size: 18px; font-weight: 600; margin-top: 0; margin-bottom: 20px; color: var(--text-main); }
h3 { font-size: 16px; font-weight: 600; margin-top: 0; margin-bottom: 15px; color: var(--text-main); }

/* FORM ELEMENTS */
label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; color: var(--text-main); margin-top: 20px; }
input[type="text"], select { 
    width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-main);
    box-sizing: border-box; font-family: 'Inter', sans-serif; font-size: 14px; transition: all 0.2s; background: var(--input-bg);
}
input[type="text"]:focus, select:focus { border-color: var(--primary); background: var(--surface); outline: none; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
input[type="range"] { width: 100%; margin-top: 10px; accent-color: var(--primary); }

.btn { 
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; border: none; padding: 14px; width: 100%; 
    cursor: pointer; border-radius: 8px; margin-top: 25px; font-weight: 600; font-size: 14px;
    transition: all 0.2s; box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.3); }
.btn:active { transform: translateY(0); }

.btn-green { background: linear-gradient(135deg, var(--success), #059669); margin-top: 12px; box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2); }
.btn-green:hover { box-shadow: 0 6px 8px -1px rgba(16, 185, 129, 0.3); }

.btn-dl-console { background: #334155; margin-top: 15px; font-size: 13px; box-shadow: none; }
.btn-dl-console:hover { background: #1e293b; transform: none; box-shadow: none; }

/* TABLES */
table { 
    width: 100%; border-collapse: separate; border-spacing: 0; background: white; 
    font-size: 13px; box-shadow: var(--shadow-sm); border-radius: var(--radius); overflow: hidden; margin-top: 10px; border: 1px solid var(--border); background: var(--surface);
}
th, td { border-bottom: 1px solid var(--border); padding: 12px 16px; text-align: left; }
th { background: var(--bg); font-weight: 600; color: var(--text-main); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
tr:last-child td { border-bottom: none; }
.mono { font-family: 'SF Mono', 'Monaco', 'Consolas', monospace; color: var(--primary); word-break: break-all; }

/* BGP SPECIFIC STYLES */
.prefix-link { color: var(--primary); text-decoration: none; font-weight: 600; display: block; margin-bottom: 2px; cursor: pointer; }
.prefix-link:hover { text-decoration: underline; }
.whois-overlay {
    background: var(--surface); border: 1px solid var(--warning); padding: 15px; margin-bottom: 20px; color: var(--text-main);
    font-size: 13px; border-radius: 8px; box-shadow: var(--shadow);
}

/* TOOLS GRID */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 15px; margin-top: 20px; }
.tool-btn { 
    background: var(--surface); border: 1px solid var(--border); padding: 25px 15px; text-align: center; 
    cursor: pointer; border-radius: 12px; font-weight: 600; color: var(--text-main); transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.tool-btn:hover { 
    border-color: var(--primary); color: var(--primary); background: var(--surface); 
    transform: translateY(-3px); box-shadow: var(--shadow-lg);
}

/* VISUAL OUTPUT STYLES */
.result-card { background: var(--surface); padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 20px; }
.result-title { font-size: 16px; font-weight: bold; margin-bottom: 15px; color: var(--text-main); border-bottom: 2px solid var(--primary); padding-bottom: 5px; display: inline-block; }

/* DNS BADGES */
.dns-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; color: white; min-width: 40px; text-align: center; }
.badge-A { background: var(--primary); }
.badge-AAAA { background: #5c2d91; }
.badge-MX { background: #008272; }
.badge-NS { background: #ffaa44; color: #333; }
.badge-TXT { background: #666; }
.badge-SOA { background: #d13438; }

/* SSL DASHBOARD */
.ssl-grid { display: flex; gap: 20px; align-items: flex-start; }
.grade-box { width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: bold; color: white; border-radius: 12px; flex-shrink: 0; box-shadow: var(--shadow); }
.grade-A { background: var(--success); }
.grade-B { background: #a4ce00; color: #333; }
.grade-C { background: #fce100; color: #333; }
.grade-D { background: var(--warning); }
.grade-F { background: var(--danger); }

.ssl-details { flex: 1; min-width: 0; } 
.detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-row span:first-child { color: var(--text-muted); white-space: nowrap; margin-right: 15px; }
.detail-row span:last-child { font-weight: 600; text-align: right; text-overflow: ellipsis; overflow: hidden; }

.alert-box { margin-top: 15px; padding: 10px; border-radius: 4px; font-size: 13px; }
.alert-safe { background: #dff6dd; color: #107c10; border: 1px solid #107c10; }
.alert-warn { background: #fff4ce; color: #333; border: 1px solid #ffaa44; }

/* CURL EXPLAINER */
.curl-flag { display: inline-block; background: var(--input-bg); border: 1px solid var(--border); padding: 5px 10px; border-radius: 6px; font-size: 12px; margin-right: 10px; cursor: pointer; user-select: none; }
.curl-flag input { margin-right: 5px; }
.curl-explanation { background: #eff6ff; border-left: 4px solid var(--primary); padding: 15px; margin-bottom: 20px; border-radius: 4px; color: #1e3a8a; font-size: 14px; line-height: 1.5; }
.curl-error { background: #fef2f2; border-left: 4px solid var(--danger); padding: 15px; margin-bottom: 20px; border-radius: 4px; color: #991b1b; font-size: 14px; line-height: 1.5; }

/* SSL BADGE */
.ssl-grade-large { width: 80px; height: 80px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 800; color: white; box-shadow: var(--shadow-lg); }
.ssl-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.ssl-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }

/* DIFF CHECKER */
table.diff { width: 100%; font-family: monospace; font-size: 12px; border: none; background: var(--surface); }
table.diff td { padding: 2px 5px; border: none; white-space: pre-wrap; overflow-wrap: anywhere; vertical-align: top; }
table.diff .diff_header { background-color: var(--border); color: var(--text-muted); white-space: nowrap; width: 1%; min-width: 30px; text-align: right; user-select: none; }
.diff_next { background-color: var(--border); }
.diff_add { background-color: rgba(16, 185, 129, 0.15); color: #6ee7b7; } /* Green */
.diff_chg { background-color: rgba(245, 158, 11, 0.15); color: #fcd34d; } /* Yellow */
.diff_sub { background-color: rgba(239, 68, 68, 0.15); color: #fca5a5; } /* Red */

/* INFO BOX (SEO CONTENT) */
.info-box {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.4));
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    backdrop-filter: blur(5px);
}
.info-box h3 { color: var(--primary); font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; margin-top: 0; }
.info-box h3::before { content: '💡'; font-size: 18px; }
.info-box p { font-size: 14px; line-height: 1.6; color: var(--text-muted); margin-bottom: 12px; }
.info-box h4 { font-size: 14px; color: var(--text-main); margin-top: 15px; margin-bottom: 8px; font-weight: 600; }

/* RAW DOCUMENT LOOK */
.doc-view { 
    background: #0f172a; padding: 25px; font-family: 'SF Mono', 'Monaco', 'Consolas', monospace; 
    font-size: 13px; border: 1px solid var(--border); border-radius: 8px; color: #e2e8f0; 
    white-space: pre-wrap; overflow-x: auto; box-shadow: var(--shadow); line-height: 1.5;
}

/* HOME DASHBOARD STYLES */
.hero-section {
    text-align: left; padding: 60px 20px;
    background: radial-gradient(circle at center, #1e293b 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border); margin-bottom: 40px;
}
.hero-section h1 { font-size: 36px; margin: 0 0 10px 0; background: linear-gradient(to right, #60a5fa, #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -1px; text-align: center; }
.hero-section p { font-size: 18px; color: var(--text-muted); max-width: 600px; margin: 0 auto; }

.tool-launcher-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px;
    max-width: 1000px; margin: 0 auto 60px auto; padding: 0 20px;
}
.launcher-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 25px;
    text-decoration: none; color: var(--text-main); transition: all 0.2s; display: flex; flex-direction: column; align-items: center; text-align: center;
}
.launcher-card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: var(--shadow-lg); }
.launcher-icon { font-size: 32px; margin-bottom: 15px; }
.launcher-title { font-weight: 700; font-size: 15px; margin-bottom: 5px; }
.launcher-desc { font-size: 12px; color: var(--text-muted); }

.intel-grid {
    display: grid; grid-template-columns: 2fr 1fr; gap: 25px;
    max-width: 1200px; margin: 0 auto 60px auto; padding: 0 20px;
}
.intel-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 25px;
    display: flex; flex-direction: column;
}
.featured-research { border-left: 4px solid var(--warning); }
.ai-sec { border-top: 4px solid #a78bfa; }
.news-feed { border-top: 4px solid var(--success); }

.badge { display: inline-block; background: rgba(245, 158, 11, 0.1); color: var(--warning); font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 4px; margin-bottom: 15px; letter-spacing: 0.5px; }
.intel-title { font-size: 18px; font-weight: 700; margin: 0 0 10px 0; }
.intel-desc { color: var(--text-muted); line-height: 1.6; font-size: 14px; flex-grow: 1; }
.read-more { margin-top: 20px; color: var(--primary); text-decoration: none; font-weight: 600; font-size: 13px; }

.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { margin-bottom: 12px; font-size: 13px; display: flex; gap: 10px; }
.news-date { font-family: monospace; color: var(--text-muted); min-width: 50px; }

/* Crawler Log Style */
.crawler-log { font-family: 'SF Mono', 'Monaco', 'Consolas', monospace; font-size: 12px; color: var(--text-muted); padding: 10px; height: 100%; overflow-y: auto; }
.crawler-line { margin-bottom: 4px; border-bottom: 1px dashed rgba(51, 65, 85, 0.5); padding-bottom: 4px; }
.crawler-line span { color: var(--primary); margin-right: 10px; }

/* DC DESIGNER */
#dc-network { 
    width: 100%; flex-grow: 1; min-height: 500px; border: 1px solid var(--border); 
    background-color: #ffffff;
    background-image: linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 8px; position: relative; 
}
.palette-bar { display: flex; gap: 10px; margin-bottom: 10px; padding: 10px; background: var(--surface); border-radius: 8px; border: 1px solid var(--border); flex-wrap: wrap; }
.palette-node { 
    padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; 
    cursor: grab; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; color: var(--text-main);
    user-select: none;
}
.palette-node:hover { border-color: var(--primary); color: var(--primary); }

/* Tool Headers - SEO Optimized */
.split-left h1 { font-size: 22px; font-weight: 700; margin-top: 0; margin-bottom: 20px; color: var(--text-main); }

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* UX: Sticky Header for Tools */
.sticky-tool-header {
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 20;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 15px;
}

@media (max-width: 900px) { .intel-grid { grid-template-columns: 1fr; } }

/* Responsive */
@media (max-width: 768px) {
    body { height: auto; overflow: auto; }
    .tab-content.active { flex-direction: column; }
    .split-left, .split-right { width: 100%; border-right: none; height: auto; }
    .nav { overflow-x: auto; }
}