/**
 * Verpex Real-Time Monitor Frontend Stylesheet
 * Brand: BrandaLAB Premium Aesthetics
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

.verpex-rtm-status-dashboard {
	font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	max-width: 1200px;
	margin: 2rem auto;
	padding: 0 1.5rem;
	color: #0f172a;
	background: transparent;
	box-sizing: border-box;
}

.verpex-rtm-status-dashboard *,
.verpex-rtm-status-dashboard *::before,
.verpex-rtm-status-dashboard *::after {
	box-sizing: border-box;
}

/* 1. Global Status Banner */
.verpex-rtm-status-banner {
	display: flex;
	align-items: center;
	padding: 2rem 2.5rem;
	border-radius: 20px;
	margin-bottom: 2.5rem;
	position: relative;
	overflow: hidden;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.5);
}

.banner-operational {
	background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
	border-color: rgba(34, 197, 94, 0.2);
}

.banner-degraded {
	background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
	border-color: rgba(245, 158, 11, 0.2);
}

.banner-maintenance {
	background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
	border-color: rgba(59, 130, 246, 0.2);
}

/* Glowing Pulsing Ring */
.banner-pulse {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	margin-right: 1.75rem;
	flex-shrink: 0;
}

.pulse-core {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	z-index: 2;
}

.pulse-glow {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	position: absolute;
	opacity: 0.4;
	z-index: 1;
}

.banner-operational .pulse-core {
	background: #22c55e;
	box-shadow: 0 0 10px #22c55e;
}
.banner-operational .pulse-glow {
	background: #22c55e;
	animation: rtmPulse 2s infinite ease-out;
}

.banner-degraded .pulse-core {
	background: #f59e0b;
	box-shadow: 0 0 10px #f59e0b;
}
.banner-degraded .pulse-glow {
	background: #f59e0b;
	animation: rtmPulse 2s infinite ease-out;
}

.banner-maintenance .pulse-core {
	background: #3b82f6;
	box-shadow: 0 0 10px #3b82f6;
}
.banner-maintenance .pulse-glow {
	background: #3b82f6;
	animation: rtmPulse 2s infinite ease-out;
}

.banner-meta {
	flex-grow: 1;
}

.verpex-rtm-status-dashboard .banner-title {
	font-size: 1.5rem !important;
	font-weight: 700 !important;
	margin: 0 0 0.25rem 0 !important;
	letter-spacing: -0.5px !important;
	line-height: 1.25 !important;
}

.banner-operational .banner-title { color: #14532d; }
.banner-degraded .banner-title { color: #78350f; }
.banner-maintenance .banner-title { color: #1e3a8a; }

.banner-desc {
	font-size: 0.95rem;
	margin: 0;
	line-height: 1.5;
}

.banner-operational .banner-desc { color: #15803d; }
.banner-degraded .banner-desc { color: #b45309; }
.banner-maintenance .banner-desc { color: #1d4ed8; }

/* 2. Planned Maintenance Warning Alerts */
.verpex-rtm-maintenance-alerts {
	margin-bottom: 2.5rem;
}

.maintenance-alert-box {
	display: flex;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-left: 5px solid #3b82f6;
	border-radius: 16px;
	padding: 1.5rem;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
	margin-bottom: 1rem;
}

.alert-icon {
	color: #3b82f6;
	margin-right: 1.25rem;
	font-size: 1.75rem;
	display: flex;
	align-items: flex-start;
	padding-top: 2px;
}

.alert-content {
	flex-grow: 1;
}

.alert-badge {
	display: inline-block;
	background: #eff6ff;
	color: #1d4ed8;
	font-size: 0.75rem;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 9999px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 0.5rem;
}

.alert-subject {
	font-size: 1.15rem;
	font-weight: 700;
	margin: 0 0 0.4rem 0;
	color: #1e293b;
}

.alert-schedule {
	font-size: 0.9rem;
	color: #64748b;
	margin: 0 0 0.75rem 0;
}

.alert-details {
	font-size: 0.95rem;
	color: #475569;
	margin: 0;
	line-height: 1.5;
}

/* Sections Styling */
.verpex-rtm-section {
	margin-bottom: 3.5rem;
}

.verpex-rtm-status-dashboard .section-title {
	font-size: 1.3rem !important;
	font-weight: 700 !important;
	margin: 0 0 1.5rem 0 !important;
	letter-spacing: -0.3px !important;
	color: #1e293b !important;
	position: relative;
	padding-bottom: 0.5rem;
}

.section-title::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 50px;
	height: 3px;
	background: #6366f1;
	border-radius: 999px;
}

/* 3. Server Card Grid */
.verpex-rtm-servers-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 1.5rem;
}

.server-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 1.5rem;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	display: flex;
	flex-direction: column;
}

.server-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.08);
}

.server-header {
	margin-bottom: 0.5rem;
}

.server-status-row {
	margin-bottom: 1rem;
	display: flex;
	align-items: center;
}

.server-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.verpex-rtm-status-dashboard .server-alias {
	font-size: 1.1rem !important;
	font-weight: 700 !important;
	margin: 0 !important;
	color: #1e293b !important;
	letter-spacing: -0.3px !important;
	line-height: 1.3 !important;
}

.server-host {
	font-size: 0.8rem;
	color: #94a3b8;
	margin-top: 2px;
	font-family: monospace;
}

/* Card states */
.card-operational { border-top: 4px solid #22c55e; }
.card-degraded { border-top: 4px solid #ef4444; }
.card-under_maintenance { border-top: 4px solid #3b82f6; }

/* Status Pills */
.status-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.75rem;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 9999px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
	flex-shrink: 0;
}

.pill-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
}

.badge-operational {
	background: #f0fdf4;
	color: #166534;
}
.badge-operational .pill-dot { background: #22c55e; }

.badge-degraded {
	background: #fee2e2;
	color: #991b1b;
}
.badge-degraded .pill-dot { background: #ef4444; }

.badge-maintenance {
	background: #eff6ff;
	color: #1e40af;
}
.badge-maintenance .pill-dot { background: #3b82f6; }

.server-desc {
	font-size: 0.85rem;
	color: #64748b;
	line-height: 1.4;
	margin: 0 0 1.25rem 0;
	flex-grow: 1;
}

.server-footer {
	border-top: 1px solid #f1f5f9;
	padding-top: 10px;
	margin-top: auto;
}

.pulse-indicator {
	font-size: 0.85rem;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 500;
}

.status-text-operational { color: #475569; }
.status-text-degraded { color: #475569; }
.status-text-under_maintenance { color: #475569; }

.pulse-indicator::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	display: inline-block;
}

.status-text-operational::before { background: #22c55e; }
.status-text-degraded::before { background: #ef4444; }
.status-text-under_maintenance::before { background: #3b82f6; }

/* 4. Timeline Logs */
.verpex-rtm-timeline {
	position: relative;
	padding-left: 24px;
	margin-left: 10px;
}

.timeline-item {
	position: relative;
	margin-bottom: 2rem;
}

.timeline-item:last-child {
	margin-bottom: 0;
}

.timeline-marker {
	position: absolute;
	left: -32px;
	top: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.marker-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #e2e8f0;
	border: 3px solid #ffffff;
	box-shadow: 0 0 0 1px #cbd5e1;
	z-index: 2;
}

.marker-line {
	width: 2px;
	flex-grow: 1;
	background: #cbd5e1;
	z-index: 1;
}

.timeline-item:last-child .marker-line {
	display: none;
}

.timeline-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 1.5rem;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.timeline-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.75rem;
	flex-wrap: wrap;
	gap: 8px;
}

.timeline-meta {
	display: flex;
	align-items: center;
	gap: 10px;
}

.timeline-type {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	padding: 2px 8px;
	border-radius: 4px;
	letter-spacing: 0.5px;
}

.type-incident {
	background: #fee2e2;
	color: #991b1b;
}

.type-maintenance {
	background: #fef3c7;
	color: #78350f;
}

.type-general {
	background: #f1f5f9;
	color: #334155;
}

.timeline-date {
	font-size: 0.85rem;
	color: #94a3b8;
}

.timeline-status {
	font-size: 0.75rem;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 9999px;
}

.status-resolved {
	background: #d1fae5;
	color: #065f46;
}

.status-active {
	background: #fee2e2;
	color: #991b1b;
	animation: blink 2s infinite ease-in-out;
}

.timeline-subject {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0 0 0.5rem 0;
	color: #1e293b;
}

.timeline-body {
	font-size: 0.9rem;
	color: #475569;
	line-height: 1.5;
}

/* Timeline Custom States */
.timeline-resolved .marker-dot {
	background: #22c55e;
	box-shadow: 0 0 0 1px #22c55e;
}

.timeline-active .marker-dot {
	background: #ef4444;
	box-shadow: 0 0 0 1px #ef4444;
	animation: blink 2s infinite ease-in-out;
}

/* Empty states */
.timeline-empty-card,
.no-data-card {
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 16px;
	padding: 2.5rem;
	text-align: center;
	color: #64748b;
}

.shield-check-icon {
	font-size: 2.5rem;
	margin-bottom: 0.75rem;
}

.timeline-empty-card h4 {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0 0 0.25rem 0;
	color: #334155;
}

.timeline-empty-card p {
	font-size: 0.9rem;
	margin: 0;
}

/* 5. Footer styling */
.verpex-rtm-footer {
	text-align: center;
	margin-top: 3.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid #e2e8f0;
	font-size: 0.8rem;
	color: #94a3b8;
}

.verpex-rtm-footer a {
	color: #6366f1;
	text-decoration: none;
	font-weight: 600;
}

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

/* Animations */
@keyframes rtmPulse {
	0% {
		transform: scale(0.6);
		opacity: 1;
	}
	100% {
		transform: scale(1.6);
		opacity: 0;
	}
}

@keyframes blink {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

@media (max-width: 640px) {
	.verpex-rtm-status-banner {
		padding: 1.5rem;
		flex-direction: column;
		align-items: flex-start;
	}
	
	.banner-pulse {
		margin-right: 0;
		margin-bottom: 1rem;
	}
	
	.timeline-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}
	
	.timeline-status {
		align-self: flex-start;
	}
}
