/* ===================================
   PROVIDERS SIDEBAR - RIGHT SIDE
   =================================== */

.provider-section-header {
    padding: 8px 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

/* Right sidebar positioning */
.sidebar-right {
    position: fixed;
    right: -340px;
    top: 60px;
    bottom: auto;
    max-height: calc(100% - 80px);
    width: 320px;
    /*height: 100%;*/
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 900;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 10px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
}

.sidebar-right.open {
    right: 0;
}

/* Providers container - AMB SCROLL */
.providers-container {
    padding: 12px;
    padding-left: 0px;
    overflow-y: auto;
    flex: 1;
}

/* Loading state */
.providers-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.providers-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: providers-spin 0.8s linear infinite;
}

.providers-loading-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

/* Empty state */
.providers-empty {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

/* Scrollbar customization for providers container */
.providers-container::-webkit-scrollbar {
    width: 6px;
}

.providers-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.providers-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.providers-container::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.3);
}


/* Animation */
@keyframes providers-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sidebar-right {
        width: 100%;
        right: -100%;
        top: 60px;
        /* Adjust based on header height */
    }

    .sidebar-right.open {
        right: 0;
    }
}


/* =========================
   NEW SECTION STYLES
   ========================= */

/* Main collapsible section (e.g. PER PROVEIDOR) */
.provider-main-section {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.provider-main-section:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

.provider-main-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    gap: 10px;
}

.provider-main-toggle {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.provider-main-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
    flex: 1;
}

.provider-main-content {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
    padding: 8px;
    /* Adding padding inside the main block */
}

/* Nested section (e.g. Meteo, Hydro) */
.provider-sub-section {
    margin-bottom: 6px;
    border-radius: 6px;
    /* No border for subsections to keep it clean */
}

.provider-sub-header {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.provider-sub-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.provider-sub-title {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.provider-sub-content {
    display: none;
    padding-left: 12px;
    /* Indent content */
    margin-top: 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 12px;
    /* Link indent with line */
}

/* Override existing layer-group to fit inside better */
.provider-sub-content .layer-group {
    margin-bottom: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
}