/* pNode-Viz Custom Styles */

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #9CA3AF;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6B7280;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4B5563;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6B7280;
}

/* Map popup styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.dark .leaflet-popup-content-wrapper {
    background: #1F2937;
    color: #F3F4F6;
}

.dark .leaflet-popup-tip {
    background: #1F2937;
}

/* Table hover effects */
.dark tbody tr:hover {
    background-color: rgba(55, 65, 81, 0.3);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #2DD4BF 0%, #F97316 50%, #A855F7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pulse animation for online indicators */
@keyframes pulse-green {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse-green {
    animation: pulse-green 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Card hover effects */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ApexCharts dark mode adjustments */
.dark .apexcharts-text {
    fill: #9CA3AF !important;
}

.dark .apexcharts-legend-text {
    color: #9CA3AF !important;
}

.dark .apexcharts-tooltip {
    background: #1F2937 !important;
    border-color: #374151 !important;
    color: #F3F4F6 !important;
}

.dark .apexcharts-tooltip-title {
    background: #374151 !important;
    border-color: #4B5563 !important;
}

/* Leaflet cluster styling */
.marker-cluster-small {
    background-color: rgba(45, 212, 191, 0.6);
}
.marker-cluster-small div {
    background-color: rgba(45, 212, 191, 0.8);
}

/* Ensure mini map fills its container */
#miniMap {
    width: 100% !important;
    height: 100% !important;
}

#miniMap .leaflet-container {
    width: 100% !important;
    height: 100% !important;
}

.marker-cluster-medium {
    background-color: rgba(249, 115, 22, 0.6);
}
.marker-cluster-medium div {
    background-color: rgba(249, 115, 22, 0.8);
}

.marker-cluster-large {
    background-color: rgba(168, 85, 247, 0.6);
}
.marker-cluster-large div {
    background-color: rgba(168, 85, 247, 0.8);
}

.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
}

.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 15px;
    font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
    font-weight: bold;
    color: white;
    line-height: 30px;
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(45, 212, 191, 0.3);
    border-radius: 50%;
    border-top: 3px solid #2DD4BF;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive table */
@media (max-width: 768px) {
    .responsive-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Focus ring */
input:focus, select:focus, button:focus {
    outline: none;
    ring: 2px;
    ring-color: #2DD4BF;
}

/* Smooth transitions */
* {
    transition-property: color, background-color, border-color;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent transition on page load */
.preload * {
    transition: none !important;
}
