.yt30global-widget {
    position: relative;
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.yt30global-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

.yt30global-sidebar {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 35px rgba(18, 32, 59, 0.08);
    position: relative;
    z-index: 2;
}

.yt30global-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.yt30global-sidebar-header h3 {
    font-size: 18px;
    margin: 0;
    color: #111827;
}

.yt30global-sidebar-close {
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    display: none;
    line-height: 1;
}

.yt30global-search {
    display: flex;
    align-items: center;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 16px;
    background: #f8fafc;
}

.yt30global-search .dashicons {
    color: #64748b;
    font-size: 16px;
    width: 20px;
    height: 20px;
}

.yt30global-search-input {
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    width: 100%;
    font-size: 14px;
    padding: 4px 6px;
    margin: 0;
    appearance: none;
}

.yt30global-search-input:focus {
    outline: none !important;
    box-shadow: none !important;
    border: 0 !important;
}

.yt30global-country-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 420px;
    overflow-y: auto;
    border-radius: 8px;
}

.yt30global-country-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    color: #0f172a;
}

.yt30global-country-item:hover {
    background: #f1f5f9;
}

.yt30global-country-item.is-active {
    background: #0073aa;
    color: #fff;
}

.yt30global-country-item .yt30global-country-code {
    font-size: 12px;
    opacity: 0.7;
    text-transform: uppercase;
}

.yt30global-empty-state {
    display: none;
    margin-top: 12px;
    font-size: 14px;
    color: #64748b;
}

.yt30global-empty-state.is-visible {
    display: block;
}

.yt30global-content {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.yt30global-content-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

.yt30global-sidebar-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    border: 1px solid #0073aa;
    background: #fff;
    color: #0073aa;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 14px;
    cursor: pointer;
}

.yt30global-sidebar-toggle .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.yt30global-tabs {
    display: inline-flex;
    gap: 8px;
    border: 1px solid #e1e1e1;
    border-radius: 999px;
    padding: 4px;
    background: #f8fafc;
}

.yt30global-tab {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    color: #0f172a;
}

.yt30global-tab.is-active {
    background: #0073aa;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0, 115, 170, 0.3);
}

.yt30global-tab.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.yt30global-chart-wrapper {
    position: relative;
    min-height: 200px;
}

.yt30global-chart-target {
    width: 100%;
    position: relative;
}

.yt30global-chart-target.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    animation: yt30globalPulse 1.2s ease-in-out infinite;
}

.yt30global-chart-notice {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #fff4ed;
    color: #be5a18;
    border: 1px solid #ffd3bd;
}

.yt30global-overlay {
    display: none;
}

@media (max-width: 1024px) {
    .yt30global-layout {
        display: block;
    }

    .yt30global-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        border-radius: 0;
        padding-top: 25px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .yt30global-widget.sidebar-open .yt30global-sidebar {
        transform: translateX(0);
    }

    .yt30global-sidebar-close {
        display: inline-flex;
    }

    .yt30global-sidebar-toggle {
        display: inline-flex;
    }

    .yt30global-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .yt30global-widget.sidebar-open .yt30global-overlay {
        opacity: 1;
        pointer-events: auto;
    }
}

@keyframes yt30globalPulse {
    0% { opacity: 0.35; }
    50% { opacity: 0.7; }
    100% { opacity: 0.35; }
}

@media (prefers-color-scheme: dark) {
    .yt30global-sidebar,
    .yt30global-content {
        background: #111827;
        border-color: #1f2937;
        color: #e2e8f0;
    }

    .yt30global-search {
        background: #1f2937;
        border-color: #1f2937;
    }

    .yt30global-country-item {
        color: #e2e8f0;
    }

    .yt30global-country-item:hover {
        background: #1f2937;
    }

    .yt30global-country-item.is-active {
        background: #0ea5e9;
    }

    .yt30global-tabs {
        background: #0f172a;
        border-color: #1f2937;
    }

    .yt30global-tab {
        color: #e2e8f0;
    }

    .yt30global-chart-notice {
        background: #452410;
        color: #fed7aa;
        border-color: #7c2d12;
    }

    .yt30global-chart-target.is-loading::after {
        background: rgba(15, 23, 42, 0.7);
    }

    .yt30global-sidebar-toggle {
        background: transparent;
        color: #0ea5e9;
        border-color: #0ea5e9;
    }
}

