/* ============================================
   ANYCAST NETWORK DASHBOARD - STYLES
   index2.css
   ============================================ */

/* ============================================
   BASE STYLES
   ============================================ */
* {
    font-family: 'Inter', sans-serif;
}

/* ============================================
   MAP STYLES
   ============================================ */
#map {
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
}

/* Push Leaflet controls down to avoid overlap with header */
.leaflet-top {
    top: 80px;
}

/* Custom map tiles - lighter style */
.leaflet-tile-pane {
    filter: saturate(0.3) brightness(1.1);
}

/* ============================================
   HEADER BAR
   ============================================ */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-container img {
    height: 40px;
    width: auto;
}

.logo-fallback {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: -0.5px;
}

/* CTA Button */
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #f47621 0%, #e06516 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(244, 118, 33, 0.4),
        0 2px 6px rgba(244, 118, 33, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(244, 118, 33, 0.5),
        0 4px 10px rgba(244, 118, 33, 0.3);
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:active {
    transform: translateY(0);
}

/* ============================================
   FLOATING PANEL STYLES
   ============================================ */
.floating-panel {
    position: fixed;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.floating-panel:hover {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2), 0 15px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* ============================================
   NODE DETAIL PANEL (Full-height sliding panel)
   ============================================ */
.node-detail-panel {
    position: fixed;
    top: 0;
    right: -500px;
    /* Hidden off-screen to the right */
    z-index: 1100;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid rgba(59, 130, 246, 0.1);
}

.node-detail-panel.active {
    right: 0;
    opacity: 1;
    visibility: visible;
}

/* ============================================
   CUSTOM MARKER STYLES - Pulsing Animation
   ============================================ */
.custom-marker {
    /* Let Leaflet handle all positioning */
    cursor: pointer;
}

.custom-marker:hover .marker-dot {
    transform: scale(1.15);
}

/* Pulsing ring animation */
.marker-pulse {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.3);
    animation: pulse 2s infinite ease-out;
    /* Position pulse behind the dot - centered */
    top: 50%;
    left: 50%;
    margin-left: -20px;
    margin-top: -20px;
    pointer-events: none;
}

.marker-configured .marker-pulse {
    background: rgba(16, 185, 129, 0.3);
}

.marker-pending .marker-pulse {
    background: rgba(245, 158, 11, 0.3);
}

@keyframes pulse {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Main marker dot */
.marker-dot {
    position: absolute;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    /* Center the dot in the icon area */
    top: 50%;
    left: 50%;
    margin-left: -12px;
    margin-top: -12px;
}

.marker-dot svg {
    width: 12px;
    height: 12px;
    fill: white;
}

/* Configured marker (green) */
.marker-configured .marker-dot {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
}

/* Pending marker (orange/amber) */
.marker-pending .marker-dot {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.5);
}

/* ============================================
   LEAFLET TOOLTIP STYLES
   ============================================ */
.leaflet-tooltip {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
}

.leaflet-tooltip::before {
    display: none;
}

/* ============================================
   SCROLLBAR STYLES
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-container {
    min-height: 120px;
}

/* ============================================
   STATUS INDICATOR
   ============================================ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ============================================
   CLOSE BUTTON
   ============================================ */
.close-btn {
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* ============================================
   LEGEND
   ============================================ */
.legend-item {
    transition: all 0.2s ease;
}

.legend-item:hover {
    background: #f1f5f9;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   FULL REPORTS DRAWER
   ============================================ */
.reports-drawer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    visibility: hidden;
    pointer-events: none;
}

.reports-drawer.active {
    visibility: visible;
    pointer-events: auto;
}

.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reports-drawer.active .drawer-backdrop {
    opacity: 1;
}

.drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 800px;
    max-width: 90vw;
    height: 100vh;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.15);
}

.reports-drawer.active .drawer-content {
    transform: translateX(0);
}

/* Table row hover effect */
.reports-drawer tbody tr {
    transition: background-color 0.15s ease;
}

.reports-drawer tbody tr:hover {
    background-color: #f8fafc;
}

/* Progress bar for node count */
.node-progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.node-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Pagination buttons */
.pagination-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
}

.pagination-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.pagination-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status badge in table */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.complete {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.partial {
    background: #dbeafe;
    color: #1e40af;
}