:root {
    --bg-color: #09090b; /* Ultra-dark zinc */
    --card-bg: rgba(18, 18, 20, 0.6); /* Translucent zinc-900 */
    --card-border: rgba(255, 255, 255, 0.06);
    --card-border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f4f4f5; /* Zinc 100 */
    --text-secondary: #a1a1aa; /* Zinc 400 */
    --text-muted: #52525b; /* Zinc 600 */
    
    /* Neon Status Colors - PRESERVED FOR CLARITY */
    --color-online: #10b981; /* Neon green */
    --color-online-glow: rgba(16, 185, 129, 0.2);
    --color-offline: #f43f5e; /* Neon red */
    --color-offline-glow: rgba(244, 63, 94, 0.2);
    --color-degraded: #f59e0b; /* Amber */
    --color-degraded-glow: rgba(245, 158, 11, 0.2);
    
    /* Accents - MONOCHROME */
    --accent: #ffffff; /* Solid White */
    --accent-glow: rgba(255, 255, 255, 0.08);
    --accent-secondary: #e4e4e7; /* Zinc 200 */
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow: 0 8px 30px 0 rgba(0, 0, 0, 0.7);
    --radius: 12px;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 40px;
}

/* Monochrome background glow */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.glow-bg::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
}

.glow-bg::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 55%;
    height: 55%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.01) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 24px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-dot {
    color: var(--accent);
    background: none;
    -webkit-text-fill-color: var(--accent);
}

.actions-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auto-refresh-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-refresh-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-muted);
    transition: .3s var(--transition);
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bg-color);
    transition: .3s var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(16px);
    background-color: var(--bg-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--card-border-hover);
    transform: translateY(-2px);
}

.stat-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Non-status wrappers are gray, status wrappers keep soft colored hues */
.stat-icon-wrapper.blue { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.stat-icon-wrapper.green { background: rgba(16, 185, 129, 0.08); color: var(--color-online); }
.stat-icon-wrapper.amber { background: rgba(245, 158, 11, 0.08); color: var(--color-degraded); }
.stat-icon-wrapper.purple { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.text-success {
    color: var(--color-online);
}

/* Control Bar & Add Domain */
.control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    padding: 3px 8px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.add-domain-form .input-group {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 3px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.add-domain-form .input-group:focus-within {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.05);
}

.input-prefix {
    padding: 0 2px 0 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    user-select: none;
}

.add-domain-form input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding: 6px 10px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    width: 180px;
}

.add-domain-form input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    height: 34px;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--card-border-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--card-border-hover);
}

.btn-accent {
    background: #ffffff;
    color: #000000;
    font-weight: 700;
}

.btn-accent:hover {
    background: #e4e4e7;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.btn-card {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-card:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: var(--card-border-hover);
}

.btn-card.delete:hover {
    background: rgba(244, 63, 94, 0.1);
    color: var(--color-offline);
    border-color: rgba(244, 63, 94, 0.2);
}

/* Monitors Grid */
.monitors-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 40px;
}

/* Loader */
.initial-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-top: 2px solid var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 14px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Monitor Card */
.monitor-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}

.monitor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background-color: var(--text-muted);
}

.monitor-card.online::before { background-color: var(--color-online); }
.monitor-card.offline::before { background-color: var(--color-offline); }
.monitor-card.loading::before { background-color: var(--text-secondary); }

.monitor-card:hover {
    border-color: var(--card-border-hover);
}

.monitor-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Card Header */
.card-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-muted);
    position: relative;
}

.online .status-indicator {
    background-color: var(--color-online);
    box-shadow: 0 0 8px var(--color-online);
}

.offline .status-indicator {
    background-color: var(--color-offline);
    box-shadow: 0 0 8px var(--color-offline);
}

.loading .status-indicator {
    background-color: var(--text-secondary);
    box-shadow: 0 0 8px var(--text-secondary);
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.4; }
    100% { transform: scale(1); opacity: 1; }
}

.domain-name-wrap {
    display: flex;
    flex-direction: column;
}

.domain-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.domain-url-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.card-quick-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.quick-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.quick-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.quick-stat-val {
    font-size: 0.95rem;
    font-weight: 700;
}

/* Latency coloring retained */
.quick-stat-val.latency-good { color: var(--color-online); }
.quick-stat-val.latency-warn { color: var(--color-degraded); }
.quick-stat-val.latency-bad { color: var(--color-offline); }

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.visit-link {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid var(--card-border);
}

.visit-link:hover {
    background: var(--accent);
    color: #000000;
    border-color: var(--accent);
}

/* Card Body (Collapsible Details) */
.card-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media(min-width: 768px) {
    .card-details {
        grid-template-columns: 1.2fr 1fr;
    }
}

.details-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-section-title i {
    width: 12px;
    height: 12px;
}

/* Monochrome Latency Timing Bars */
.timing-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timing-bar-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
}

.timing-label {
    color: var(--text-secondary);
    width: 80px;
}

.timing-bar-container {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
    margin: 0 10px;
    overflow: hidden;
    position: relative;
}

.timing-bar {
    height: 100%;
    background: var(--text-secondary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.8s ease-out;
}

/* The total bar uses pure white/accent to draw contrast in monochrome */
.timing-bar-total-monochrome {
    background: var(--accent) !important;
}

.timing-val {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-weight: 600;
    width: 45px;
    text-align: right;
}

/* Grid Tech Details Table */
.tech-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}

.tech-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tech-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.tech-val {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-primary);
    word-break: break-all;
}

/* SSL Section */
.ssl-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 10px 14px;
}

.ssl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.ssl-status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
}

/* SSL retain soft colors for indicators */
.ssl-status-badge.secure {
    background: rgba(16, 185, 129, 0.08);
    color: var(--color-online);
}

.ssl-status-badge.warning {
    background: rgba(244, 63, 94, 0.08);
    color: var(--color-offline);
}

.ssl-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.ssl-expiry {
    font-weight: 600;
    color: var(--text-primary);
}

/* DNS Records Table */
.dns-records-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dns-type-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-left: 2px solid rgba(255, 255, 255, 0.03);
    padding-left: 10px;
}

.dns-type-name {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dns-type-vals {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dns-val-item {
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    border-radius: 3px;
    transition: var(--transition);
}

.copy-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.no-dns {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.75rem;
}

/* Collapsible toggle mechanics */
.expand-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 4px 8px;
    border-radius: 4px;
}

.expand-toggle:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.02);
}

.expand-toggle i {
    transition: transform 0.2s ease;
}

.expand-toggle.active i {
    transform: rotate(180deg);
}

.card-details.collapsed {
    display: none !important;
}

/* Footer styling */
footer {
    margin-top: 50px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
}

footer p {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Toast Notification Styling */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: rgba(9, 9, 11, 0.95);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 12px 18px;
    min-width: 240px;
    max-width: 360px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(80px);
    opacity: 0;
    animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Toast borders preserve soft status color indicators */
.toast.info { border-left: 3px solid var(--text-primary); }
.toast.success { border-left: 3px solid var(--color-online); }
.toast.error { border-left: 3px solid var(--color-offline); }

.toast-message {
    font-size: 0.8rem;
    color: var(--text-primary);
    flex-grow: 1;
}

.toast-icon {
    display: flex;
    align-items: center;
}

.toast.info .toast-icon { color: var(--text-secondary); }
.toast.success .toast-icon { color: var(--color-online); }
.toast.error .toast-icon { color: var(--color-offline); }

@keyframes toast-in {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive updates */
@media(max-width: 600px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .actions-area {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .control-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .add-domain-form, .add-domain-form .input-group, .add-domain-form input {
        width: 100%;
    }
    
    .card-header-main {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-quick-stats {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
        margin-top: 10px;
    }
}
