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

:root {
    --primary: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --gray: #95a5a6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.header h1 {
    font-size: 1.8rem;
    color: #fff;
}

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

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #333;
    color: white;
}

.btn-secondary:hover {
    background: #444;
}

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

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #16213e;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border-left: 4px solid;
}

.stat-total { border-color: var(--primary); }
.stat-healthy { border-color: var(--success); }
.stat-error { border-color: var(--danger); }
.stat-suspicious { border-color: var(--warning); }

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-total .stat-value { color: var(--primary); }
.stat-healthy .stat-value { color: var(--success); }
.stat-error .stat-value { color: var(--danger); }
.stat-suspicious .stat-value { color: var(--warning); }

.stat-label {
    color: #888;
    font-size: 0.9rem;
}

/* Alert Banner */
.alert-banner {
    background: linear-gradient(90deg, var(--danger), #c0392b);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: pulse 1s infinite;
}

.alert-banner.hidden {
    display: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-icon {
    font-size: 1.5rem;
}

.alert-dismiss {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 20px;
    background: #16213e;
    border: none;
    border-radius: 20px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    background: #1f3460;
}

.tab.active {
    background: var(--primary);
    color: white;
}

/* Sites Grid */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.site-card {
    background: #16213e;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid;
    position: relative;
}

.site-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.site-card.healthy { border-color: var(--success); }
.site-card.error { border-color: var(--danger); }
.site-card.warning { border-color: var(--warning); }
.site-card.unknown { border-color: var(--gray); }

.site-card.error {
    animation: errorPulse 2s infinite;
}

@keyframes errorPulse {
    0%, 100% { background: #16213e; }
    50% { background: #2a1f2f; }
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.site-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
    word-break: break-word;
}

.site-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-healthy { background: var(--success); color: white; }
.status-error { background: var(--danger); color: white; }
.status-warning { background: var(--warning); color: white; }
.status-unknown { background: var(--gray); color: white; }

.site-url {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 15px;
    word-break: break-all;
}

.site-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
}

.site-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.response-time.slow { color: var(--warning); }
.response-time.fast { color: var(--success); }

/* Loading */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #666;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 2rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    transition: all 0.2s;
}

.fab:hover {
    transform: scale(1.1);
}

.fab-secondary {
    bottom: 100px;
    background: var(--success);
    font-size: 1.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #16213e;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
}

.modal-large {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #888;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #0f0f23;
    color: #fff;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Connection Status */
.connection-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #16213e;
    border-radius: 20px;
    font-size: 0.8rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warning);
}

.connection-status.connected .status-dot {
    background: var(--success);
}

.connection-status.disconnected .status-dot {
    background: var(--danger);
}

/* Site Details */
.details-section {
    margin-bottom: 25px;
}

.details-section h3 {
    margin-bottom: 15px;
    color: #888;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    background: #0f0f23;
    padding: 15px;
    border-radius: 8px;
}

.detail-label {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 500;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #0f0f23;
    margin-bottom: 5px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.suspicious-list {
    max-height: 300px;
    overflow-y: auto;
}

.suspicious-item {
    background: #0f0f23;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 3px solid var(--warning);
}

.suspicious-url {
    word-break: break-all;
    color: var(--warning);
    font-size: 0.85rem;
}

.suspicious-reason {
    color: #888;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .sites-grid {
        grid-template-columns: 1fr;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }
}
