:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-border: rgba(239, 68, 68, 0.5);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    border-radius: 16px;
}

/* Login Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    text-align: center;
    animation: fadeInUp 0.5s ease-out;
}

.login-card h2 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.5);
    color: white;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.error-msg {
    color: var(--danger);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    min-height: 20px;
}

.feedback-msg {
    font-size: 0.875rem;
    margin-top: 0.75rem;
    min-height: 20px;
    text-align: center;
}

.feedback-msg.success { color: var(--success); }
.feedback-msg.error { color: var(--danger); }

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-full {
    width: 100%;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: var(--warning);
    color: #1e293b;
    font-weight: 700;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: white;
}

/* Dashboard Header */
.dashboard {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.glass-header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: background-color 0.3s;
}

.pulse-dot.active {
    background-color: var(--success);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 2s infinite;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

.badge {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    vertical-align: super;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.summary-bar {
    display: flex;
    gap: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.summary-count {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
}

.summary-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
}

.summary-ok .summary-count { color: var(--success); }
.summary-fail .summary-count { color: var(--danger); }

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Main Content Area */
.monitor-container {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    color: var(--text-muted);
    background: rgba(30, 41, 59, 0.4);
    border-radius: 16px;
    border: 1px dashed var(--glass-border);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h2 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

/* Status Cards */
.status-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.ip-address {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: monospace;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-ok {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-fail {
    background: var(--danger);
    color: white;
    border: 1px solid var(--danger-border);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    animation: flash-border 2s infinite;
}

.badge-pending {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.badge-warn {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    font-weight: 600;
}

.spam-details {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--danger-bg);
    border-left: 3px solid var(--danger);
    border-radius: 4px;
    font-size: 0.85rem;
    color: #fca5a5;
    word-break: break-word;
}

/* Specific styling for SPAM cards */
.status-card.is-spam {
    border-color: var(--danger-border);
    background: linear-gradient(to bottom, rgba(30, 41, 59, 0.9), rgba(127, 29, 29, 0.2));
}

.status-card.is-spam .ip-address {
    color: #f87171;
}

/* Footer */
.glass-footer {
    background: rgba(15, 23, 42, 0.9);
    border-top: 1px solid var(--glass-border);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.status-running {
    color: var(--success);
    font-weight: 700;
}

/* Settings Modal Specifics */
.settings-card {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    animation: fadeInUp 0.3s ease-out;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    position: sticky;
    top: -2rem;
    background: var(--glass-bg);
    padding-top: 2rem;
    padding-bottom: 1rem;
    margin-top: -2rem;
    z-index: 10;
    border-bottom: 1px solid var(--glass-border);
}

.settings-header h2 {
    font-size: 1.5rem;
    color: white;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-section h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-row {
    display: flex;
    gap: 1rem;
}

.settings-row .btn {
    flex: 1;
}

textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-family: monospace;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.divider {
    border: none;
    border-top: 1px dashed var(--glass-border);
    margin: 0.5rem 0;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

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

@keyframes flash-border {
    0%, 100% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.8); }
}

/* Responsive */
@media (max-width: 768px) {
    .glass-header { 
        flex-direction: column; 
        gap: 1rem; 
        align-items: flex-start;
        padding: 1rem;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    .monitor-grid {
        grid-template-columns: 1fr;
    }
    .settings-row {
        flex-direction: column;
    }
}

/* Tab Buttons & Export UI */
.tab-buttons {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

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

.tab-btn:hover:not(.active) {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.export-actions {
    display: flex;
    gap: 1rem;
}

.export-actions .btn {
    flex: 1;
}

.summary-item {
    cursor: pointer;
    transition: transform 0.2s;
}

.summary-item:hover {
    transform: translateY(-2px);
}

