:root {
    --bg-main: #0c1017;
    --bg-card: rgba(22, 27, 34, 0.85);
    --bg-header: rgba(13, 17, 23, 0.95);
    --border-color: rgba(48, 54, 61, 0.8);
    --accent-blue: #58a6ff;
    --accent-cyan: #38bdf8;
    --accent-green: #2ea043;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.fs-7 {
    font-size: 0.75rem;
}

.bg-dark-glass {
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.brand-icon {
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.brand-text {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.status-pill {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.status-online {
    background: rgba(46, 160, 67, 0.15);
    color: #3fb950;
    border: 1px solid rgba(46, 160, 67, 0.3);
}

.status-n8n {
    background: rgba(255, 110, 64, 0.15);
    color: #ff7b54;
    border: 1px solid rgba(255, 110, 64, 0.3);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #3fb950;
    box-shadow: 0 0 8px #3fb950;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(63, 185, 80, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}

.alert-dark-custom {
    background: rgba(22, 27, 34, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.alert-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.stat-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-dark {
    background-color: rgba(48, 54, 61, 0.6);
    border-radius: 10px;
    overflow: hidden;
}

.camera-mini-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.camera-mini-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    background: rgba(13, 17, 23, 0.5);
    border: 1px solid rgba(48, 54, 61, 0.4);
    font-size: 0.85rem;
}

.dot-online {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #3fb950;
}

.card-custom {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
}

.card-header-custom {
    background: rgba(13, 17, 23, 0.8);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.date-pill {
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.date-pill:hover {
    color: #ffffff;
    border-color: var(--accent-blue);
}

.date-pill.active {
    background: #0969da;
    border-color: #0969da;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(9, 105, 218, 0.4);
}

.video-card {
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.video-thumb-container {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.video-thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
}

.video-card:hover .video-play-overlay {
    opacity: 1;
}

.play-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.9);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
}

.badge-timestamp {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.badge-cam-label {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    z-index: 2;
}

.badge-event-motion {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 3px 8px;
    border-radius: 6px;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.bg-purple {
    background-color: #9333ea !important;
    color: #fff !important;
}

.motion-tag-box {
    font-size: 0.76rem;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.2);
    margin-bottom: 0.4rem;
}

.video-card-body {
    padding: 0.85rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.video-filename {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.35rem;
    word-break: break-all;
}

.video-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Video Thumbnail Real Image */
.video-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background-color: #161b22;
}

/* Live Stream Camera Card */
.cam-preview-container {
    position: relative;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cam-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
    display: block;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.cam-preview-container:hover .cam-preview {
    filter: brightness(1.06);
}

.cam-preview-container:hover .hover-fullscreen-hint {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.hover-fullscreen-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(56, 189, 248, 0.6);
    color: #fff;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    z-index: 5;
}

.cam-badge-live {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(239, 68, 68, 0.9);
    color: white;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    z-index: 2;
}

.cam-badge-zoom {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(15, 23, 42, 0.75);
    color: #e2e8f0;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
    transition: all 0.15s ease;
}

.cam-badge-zoom:hover {
    background-color: var(--accent-cyan);
    color: #000;
}

/* Fullscreen Modal */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.97);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(8px);
}

.fullscreen-header {
    width: 100%;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    z-index: 10001;
}

.fullscreen-img-container {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 10px;
}

.fullscreen-img {
    max-width: 100%;
    max-height: 88vh;
    object-fit: contain;
}

.fullscreen-footer {
    width: 100%;
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #8b949e;
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    z-index: 10001;
}

.btn-xs {
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
}
