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

:root {
    --bg-dark:        #050d1a;
    --bg-mid:         #0a1628;
    --fab-blue:       #003DA5;
    --fab-blue-light: #1a5bbf;
    --fab-blue-glow:  rgba(0, 61, 165, 0.5);
    --fab-gold:       #C9A84C;
    --fab-gold-light: #e8c96a;
    --card-bg:        rgba(10, 22, 40, 0.85);
    --text-primary:   #e8edf5;
    --text-secondary: #6d8ab0;
    --accent-green:   #00e676;
    --accent-red:     #ff1744;
    --accent-orange:  #ff9100;
    --glass-border:   rgba(0, 61, 165, 0.35);
    --scan-line:      rgba(0, 100, 255, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

/* Fundo com gradiente militar + grade sutil */
body {
    background-color: var(--bg-dark);
    background-image:
        linear-gradient(0deg, var(--scan-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--scan-line) 1px, transparent 1px),
        radial-gradient(ellipse at 20% 20%, rgba(0, 61, 165, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 80%, rgba(10, 30, 80, 0.4) 0%, transparent 55%);
    background-size: 40px 40px, 40px 40px, 100% 100%, 100% 100%;
    min-height: 100vh;
    color: var(--text-primary);
    padding: 2rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ─── HEADER ─── */
header {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, var(--fab-gold), transparent);
}

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

.fab-badge {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fab-badge img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}

h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(90deg, #e8edf5, var(--fab-gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--fab-gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 500;
    margin-top: 0.2rem;
}

/* ─── GRADE DE CARDS ─── */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* ─── CARD ─── */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

/* Barra de acento dourada no topo do card */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--fab-blue-light), var(--fab-gold), transparent);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.5),
        0 0 30px var(--fab-blue-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--fab-gold);
    margin-bottom: 1rem;
    letter-spacing: 0.12em;
}

.card-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

/* ─── INDICADORES ─── */
.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.indicator.online  { background-color: var(--accent-green);  box-shadow: 0 0 12px var(--accent-green); }
.indicator.offline { background-color: var(--accent-red);    box-shadow: 0 0 12px var(--accent-red); }
.indicator.running { background-color: var(--accent-orange); box-shadow: 0 0 12px var(--accent-orange); }

/* ─── HISTÓRICO ─── */
.history-section {
    margin-top: 1rem;
}

.history-section h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fab-gold);
    margin-bottom: 1rem;
}

.history-list {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.history-item {
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(0, 61, 165, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.history-item:hover {
    background: rgba(0, 61, 165, 0.1);
}

.history-item:last-child {
    border-bottom: none;
}

.event-type {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.event-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 0.05em;
}

.event-media {
    margin-left: 1rem;
    color: var(--fab-gold);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.event-media:hover { color: var(--fab-gold-light); }

/* ─── STATUS DE CONEXÃO ─── */
#last-sync {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
}

#connection-status {
    width: 14px;
    height: 14px;
}

/* ─── ANIMAÇÕES ─── */
@keyframes pulse {
    0%   { opacity: 1; }
    50%  { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes scanline {
    0%   { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

.pulse { animation: pulse 1.5s infinite ease-in-out; }

/* ─── RESPONSIVO ─── */
@media (max-width: 600px) {
    body { padding: 1rem; }
    h1   { font-size: 1.6rem; }
    .card { padding: 1.5rem; }
    .fab-badge { width: 40px; height: 40px; font-size: 1.1rem; }
}
