@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@500;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    color-scheme: light;
    --bg: #f7fafc;
    --bg-soft: #eef7f6;
    --surface: #ffffff;
    --surface-2: #f2f6f8;
    --ink: #0f172a;
    --muted: #5b677a;
    --border: #d7e2ea;
    --accent: #0f766e;
    --accent-2: #f59e0b;
    --accent-3: #0ea5e9;
    --danger: #e11d48;
    --success: #16a34a;
    --ring: rgba(15, 118, 110, 0.25);
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    --shadow-soft: 0 8px 18px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f172a;
    --bg-soft: #1a2a40;
    --surface: #1a2a40;
    --surface-2: #233859;
    --ink: #f7fafc;
    --muted: #a4b7c8;
    --border: #3d5065;
    --accent: #0f766e;
    --accent-2: #f59e0b;
    --accent-3: #0ea5e9;
    --danger: #ff6b7a;
    --success: #34d399;
    --ring: rgba(15, 118, 110, 0.25);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
    --shadow-soft: 0 8px 18px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
}

body {
    margin: 0;
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    color: var(--ink);
    background: radial-gradient(1200px 600px at 85% -10%, #fff3d6 0%, transparent 60%),
        radial-gradient(800px 500px at -10% 15%, #d8f3f0 0%, transparent 55%),
        var(--bg);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
    background: radial-gradient(1200px 600px at 85% -10%, rgba(31, 58, 86, 0.3) 0%, transparent 60%),
        radial-gradient(800px 500px at -10% 15%, rgba(15, 118, 110, 0.1) 0%, transparent 55%),
        var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, h4 {
    font-family: "Fraunces", "Times New Roman", serif;
    margin: 0;
}

p {
    margin: 0;
    color: var(--muted);
}

.page {
    padding: 24px 20px 60px;
}

.shell {
    width: min(1280px, 100%);
    margin: 0 auto;
    overflow-x: hidden;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
    padding: 20px 24px;
    background: var(--surface);
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.brand h1,
.brand h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

.brand p {
    font-size: 0.9rem;
    margin-top: 2px;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.nav a {
    padding: 10px 18px;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.nav a:hover {
    color: var(--ink);
    background: var(--surface-2);
}

.nav .nav-primary {
    background: var(--accent);
    color: #ffffff;
    margin-left: 8px;
}

.nav .nav-primary:hover {
    background: #0d6b63;
    border-color: #0d6b63;
    color: #ffffff;
}

.card {
    background: var(--surface);
    border-radius: 18px;
    border: 1px solid var(--border);
    padding: 28px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
    overflow-x: auto;
}

.notice {
    border-radius: 12px;
    padding: 16px 18px;
    border: 2px solid transparent;
    background: var(--surface-2);
    color: var(--ink);
    font-weight: 500;
    margin-bottom: 20px;
}

.notice.error {
    border-color: rgba(225, 29, 72, 0.3);
    background: rgba(225, 29, 72, 0.08);
    color: #9f1239;
}

.notice.success {
    border-color: rgba(22, 163, 74, 0.3);
    background: rgba(22, 163, 74, 0.08);
    color: #166534;
}

.notice.hidden {
    display: none;
}

.badge-row {
    margin: 6px 0 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
}

.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.global-footer {
    margin: 28px auto 0;
    width: min(1280px, calc(100% - 40px));
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.global-footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.global-footer a {
    color: var(--accent);
    font-weight: 600;
}

.global-footer a:hover {
    text-decoration: underline;
}

.global-footer-brand {
    color: var(--ink);
    font-weight: 700;
}

.global-footer-sep {
    opacity: 0.55;
}

.contact-card {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.contact-grid {
    display: grid;
    gap: 14px;
}

.contact-line {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}

.contact-link {
    color: var(--accent);
    font-weight: 600;
    word-break: break-word;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 0.9rem;
}

.sub-card {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    margin-top: 12px;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.section-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.section-title h2 {
    font-size: 1.7rem;
    font-weight: 600;
}

.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    align-items: center;
}

.hero-split {
    align-items: stretch;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    font-weight: 600;
    width: fit-content;
}

.pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0f766e;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.2);
}

.hero-panel {
    display: grid;
    gap: 14px;
}

.panel-card {
    padding: 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(14, 165, 233, 0.1));
    border: 1px solid rgba(15, 118, 110, 0.18);
    box-shadow: var(--shadow-soft);
}

.panel-card h2 {
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.stat-chip {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.stat-chip.accent {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.3);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--ink);
}

.stat-label {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.hero h1 {
    font-size: clamp(2.2rem, 3vw, 3.4rem);
    line-height: 1.1;
}

.hero p {
    font-size: 1.05rem;
    margin-top: 10px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

button,
.btn {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    padding: 11px 22px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
    background: var(--accent);
    color: #ffffff;
    box-shadow: none;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    background: #0d6b63;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
}

.btn-secondary {
    background: var(--accent-2);
    color: #1f2937;
}

.btn-secondary:hover {
    background: #de8f0a;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.btn-ghost {
    background: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #be0c3a;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.2);
}

.btn-wide {
    padding-left: 32px;
    padding-right: 32px;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    caret-color: var(--ink);
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 1;
}

select option {
    background: var(--surface);
    color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--ring);
}

.form-grid {
    display: grid;
    gap: 20px;
}

.form-row {
    display: grid;
    gap: 10px;
}

.form-row label {
    font-size: 0.95rem;
    color: var(--ink);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: var(--accent);
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.protocols {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    color: var(--muted);
    max-height: 320px;
    overflow-y: auto;
    padding: 16px;
    background: var(--surface-2);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.protocols label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.protocols label:hover {
    background: rgba(15, 118, 110, 0.08);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.stat-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.stat-card {
    padding: 24px;
    border-radius: 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    transition: all 0.2s ease;
    cursor: pointer;
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-card p {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-card.accent {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(255, 237, 213, 0.95));
    border-color: rgba(245, 158, 11, 0.2);
}

.stat-card.cool {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(226, 248, 255, 0.9));
    border-color: rgba(14, 165, 233, 0.2);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 0;
}

.honeypot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.honeypot-summary-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.honeypot-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.honeypot-summary-header h3 {
    font-size: 1.18rem;
    line-height: 1.25;
}

.honeypot-summary-description {
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
}

.honeypot-summary-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    font-size: 0.9rem;
    color: var(--muted);
}

.honeypot-summary-meta span {
    line-height: 1.4;
}

.honeypot-summary-meta strong {
    color: var(--ink);
}

.honeypot-summary-action {
    margin-top: 4px;
    align-self: flex-start;
}

.chart-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    overflow: hidden;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.chart-container h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.chart-container canvas {
    max-width: 100%;
    max-height: 100%;
    flex: 1;
    min-height: 0;
}

.table-wrap {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.logs-table th {
    text-align: left;
    background: var(--accent);
    color: #ffffff;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.logs-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
}

.logs-table tbody tr:hover {
    background: var(--surface-2);
}

.logs-table tbody tr:last-child td {
    border-bottom: none;
}

.status-pill {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-pill.success {
    background: rgba(22, 163, 74, 0.15);
    color: #166534;
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.status-pill.connection {
    background: rgba(20, 184, 166, 0.24);
    color: #134e4a;
    border: 1px solid rgba(20, 184, 166, 0.58);
}

.status-pill.failed {
    background: rgba(225, 29, 72, 0.15);
    color: #9f1239;
    border: 1px solid rgba(225, 29, 72, 0.3);
}

.status-pill.brute_force {
    background: rgba(234, 88, 12, 0.15);
    color: #9a3412;
    border: 1px solid rgba(234, 88, 12, 0.35);
}

.status-pill.reconnaissance {
    background: rgba(99, 102, 241, 0.15);
    color: #3730a3;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.status-pill.scan {
    background: rgba(245, 158, 11, 0.15);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.infiltration {
    background: rgba(225, 29, 72, 0.18);
    color: #9f1239;
    border: 1px solid rgba(225, 29, 72, 0.35);
}

.status-pill.error {
    background: rgba(239, 68, 68, 0.15);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-pill.unknown {
    background: rgba(148, 163, 184, 0.15);
    color: #475569;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.status-pill.active {
    background: rgba(22, 163, 74, 0.15);
    color: #166534;
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.status-pill.inactive {
    background: rgba(148, 163, 184, 0.15);
    color: #475569;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

[data-theme="dark"] .status-pill.connection {
    background: rgba(45, 212, 191, 0.34);
    color: #ccfbf1;
    border: 1px solid rgba(45, 212, 191, 0.72);
}

.card-list {
    display: grid;
    gap: 20px;
}

.honeypot-card {
    border-radius: 18px;
    border: 1px solid var(--border);
    padding: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: all 0.2s ease;
}

.honeypot-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.honeypot-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.honeypot-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.honeypot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.helper-text {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}

.confirm-panel {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff1f2;
    border: 1px solid rgba(225, 29, 72, 0.2);
    color: #9f1239;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 2;
}

.confirm-panel.active {
    display: flex;
}

.confirm-panel button {
    min-width: 120px;
}

.confirm-host {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.edit-form {
    display: none;
    margin-top: 16px;
    padding: 16px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.edit-form.active {
    display: block;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    width: min(720px, 92vw);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.modal pre {
    background: var(--surface-2);
    padding: 12px;
    border-radius: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid var(--border);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.auth-card {
    width: min(440px, 100%);
    margin: 0 auto;
}

.link-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    font-size: 0.9rem;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.link-row a {
    color: var(--accent);
    font-weight: 600;
    transition: color 0.2s ease;
}

.link-row a:hover {
    color: #0d6b63;
}

.filter-bar {
    display: flex;
    gap: 12px;
    background: var(--surface);
    border-radius: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar > * {
    flex: 1;
    min-width: 200px;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 720px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav {
        width: 100%;
    }

    .hero-actions {
        width: 100%;
    }

    .honeypot-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .honeypot-summary-meta {
        grid-template-columns: 1fr;
    }
}

.fade-up {
    animation: fadeUp 0.6s ease forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Theme Toggle Button */
#theme-toggle {
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--ink);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

#theme-toggle:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    transform: scale(1.05);
}

#theme-toggle:active {
    transform: scale(0.98);
}
