* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --border-color: #e1e8ed;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 80px;
}

/* Navigation Menu */
.nav-menu {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 101;
    box-shadow: var(--shadow);
}

.nav-menu ul {
    list-style: none;
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
}

.nav-menu li {
    flex: 1;
}

.nav-menu a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-menu a:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.nav-menu a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 51px; /* Height of nav menu */
    z-index: 100;
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    opacity: 0.9;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.status-indicator {
    font-size: 10px;
    animation: pulse 2s ease-in-out infinite;
}

.status-indicator.connected {
    color: #4ade80;
}

.status-indicator.disconnected {
    color: #f87171;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.badge {
    background: var(--border-color);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.filter-btn.active .badge {
    background: rgba(255,255,255,0.3);
    color: white;
}

/* Search Bar */
.search-bar {
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.search-bar input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px 20px;
}

/* Host Card */
.host-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.host-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.host-card.blocked {
    background: #fef2f2;
    border-left: 4px solid var(--danger-color);
}

.host-info {
    flex: 1;
    min-width: 0;
}

.host-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.host-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.host-ip, .host-mac {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.host-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
}

.host-status.active {
    background: #d4edda;
    color: #155724;
}

.host-status.blocked {
    background: #f8d7da;
    color: #721c24;
}

.host-status.inactive {
    background: #e2e3e5;
    color: #383d41;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-block {
    background: var(--danger-color);
    color: white;
}

.btn-block:hover {
    background: #c82333;
}

.btn-block:active {
    transform: scale(0.95);
}

.btn-unblock {
    background: var(--success-color);
    color: white;
}

.btn-unblock:hover {
    background: #218838;
}

.btn-unblock:active {
    transform: scale(0.95);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* FAB */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 99;
}

.fab:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    transform: scale(1.05);
}

.fab:active {
    transform: scale(0.95) rotate(180deg);
}

.fab svg {
    color: var(--primary-color);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

/* Dialog */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dialog {
    background: white;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dialog-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.dialog-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.dialog-body {
    padding: 20px;
}

.dialog-actions {
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }
    
    .host-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
    }
    
    .toast {
        min-width: auto;
        width: calc(100vw - 40px);
    }
}
