/* Left side panel (Tag Cloud) — left-window.js */

#ac-left-window.ac-left-open.ac-panel-positioned {
    right: auto !important;
    bottom: auto !important;
}

#ac-left-window.ac-left-open.ac-left-fullscreen {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    display: flex !important;
    flex-direction: column;
    margin: 0;
    z-index: 999999;
    overflow: hidden;
}
.admin-bar #ac-left-window.ac-left-open.ac-left-fullscreen {
    top: 32px !important;
    height: calc(100vh - 32px) !important;
    height: calc(100dvh - 32px) !important;
    max-height: calc(100dvh - 32px) !important;
}
#ac-left-window.ac-left-open.ac-left-fullscreen .ac-left-window-box {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
}
#ac-left-window.ac-left-open.ac-left-fullscreen .ac-left-header {
    border-radius: 0;
    cursor: default;
}
#ac-left-window.ac-left-open.ac-left-fullscreen .ac-left-body {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    max-height: none !important;
    border-radius: 0;
}

/* ── Left widgets panel (mirrors AI chatbot window) ── */
#ac-left-window {
    box-sizing: border-box;
    position: fixed;
    z-index: 9999;
    display: none;
    font-family: inherit;
    --ac-left-radius: 10px;
    --ac-left-header-bg: #0084ff;
    --ac-left-header-color: #ffffff;
    --ac-left-body-bg: #fafafa;
    --ac-left-font-color: #1f2937;
}
#ac-left-window.ac-left-open {
    display: block;
    overflow: visible;
}
#ac-left-window .ac-left-window-box {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    border-radius: var(--ac-left-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    background: var(--ac-left-body-bg);
}
#ac-left-window .ac-left-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    height: 32px;
    min-height: 32px;
    padding: 0 0 0 15px;
    background: var(--ac-left-header-bg);
    color: var(--ac-left-header-color);
    border-radius: var(--ac-left-radius) var(--ac-left-radius) 0 0;
    cursor: move;
    user-select: none;
    position: relative;
}
#ac-left-window .ac-left-buttons,
#ac-left-window .ac-left-close-button,
#ac-left-window .ac-left-resize-button {
    cursor: pointer;
}
#ac-left-window .ac-left-name {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#ac-left-window .ac-left-buttons {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex: 0 0 auto;
    position: relative;
    z-index: 3;
}
#ac-left-window .ac-left-close-button {
    position: relative;
    width: 32px;
    height: 32px;
    margin: 0 0 0 -10px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: var(--ac-left-radius);
}
#ac-left-window .ac-left-close-button::before,
#ac-left-window .ac-left-close-button::after {
    content: " ";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.2px;
    height: 22px;
    margin-top: -11px;
    margin-left: -0.6px;
    background: var(--ac-left-header-color);
    transition: transform 0.2s ease-out;
}
#ac-left-window .ac-left-close-button::before {
    transform: rotate(45deg);
}
#ac-left-window .ac-left-close-button::after {
    transform: rotate(-45deg);
}
#ac-left-window .ac-left-close-button:hover::before {
    transform: rotate(135deg);
}
#ac-left-window .ac-left-close-button:hover::after {
    transform: rotate(45deg);
}
#ac-left-window .ac-left-resize-button {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: var(--ac-left-radius);
}
#ac-left-window .ac-left-resize-button::before {
    transition: all 0.2s ease-out;
    content: " ";
    cursor: pointer;
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--ac-left-header-color);
    border: 0;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='butt' stroke-linejoin='miter'%3E%3Cpath d='M3 9V3h6'/%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M21 15v6h-6'/%3E%3Cpath d='M9 21H3v-6'/%3E%3C/svg%3E") no-repeat center/contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='butt' stroke-linejoin='miter'%3E%3Cpath d='M3 9V3h6'/%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M21 15v6h-6'/%3E%3Cpath d='M9 21H3v-6'/%3E%3C/svg%3E") no-repeat center/contain;
}
#ac-left-window .ac-left-resize-button:hover::before {
    width: 22px;
    height: 22px;
}
#ac-left-window.ac-left-fullscreen .ac-left-resize-button::before {
    width: 20px;
    height: 20px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='butt' stroke-linejoin='miter'%3E%3Cpath d='M8 3V8H3'/%3E%3Cpath d='M21 8H16V3'/%3E%3Cpath d='M3 16H8V21'/%3E%3Cpath d='M16 21V16H21'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='butt' stroke-linejoin='miter'%3E%3Cpath d='M8 3V8H3'/%3E%3Cpath d='M21 8H16V3'/%3E%3Cpath d='M3 16H8V21'/%3E%3Cpath d='M16 21V16H21'/%3E%3C/svg%3E");
}
#ac-left-window.ac-left-fullscreen .ac-left-resize-button:hover::before {
    width: 22px;
    height: 22px;
}
#ac-left-window .ac-left-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px;
    background: var(--ac-left-body-bg);
    color: var(--ac-left-font-color);
    font-size: 14px;
    line-height: 1.5;
    border-radius: 0 0 var(--ac-left-radius) var(--ac-left-radius);
}
#ac-left-window .ac-left-empty {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}
#ac-left-window .ac-left-widget:not(:last-child) {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}
#ac-left-window .ac-left-panel-book-promo iframe.ac-left-panel-book-frame {
    display: block;
    width: 100%;
    max-width: 300px;
    min-width: 0;
    height: 200px;
    margin: 0 auto;
    border: 0;
    padding: 0;
    overflow: hidden;
}
#ac-left-window .ac-left-panel-hplus-ad {
    text-align: center;
}
#ac-left-window .ac-left-panel-featured-post {
    text-align: center;
}
#ac-left-window .ac-left-panel-featured-post-image {
    display: block;
    margin: 0 auto 10px;
    text-decoration: none;
    cursor: pointer;
}
#ac-left-window .ac-left-panel-featured-post-image img,
#ac-left-window .ac-left-panel-hplus-ad a img,
#ac-left-window .ac-left-panel-book-promo > a img {
    display: block;
    cursor: pointer !important;
    -webkit-user-drag: none;
    user-drag: none;
}
#ac-left-window .ac-left-panel-featured-post-image img {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto;
    border-radius: 6px;
}
#ac-left-window .ac-left-panel-featured-post-title {
    margin: 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.4;
}
#ac-left-window .ac-left-panel-featured-post-title a {
    color: #367bb7;
    text-decoration: none;
}
#ac-left-window .ac-left-panel-featured-post-title a:hover {
    color: #1a5a9a;
    text-decoration: underline;
}
#ac-left-window .ac-left-widget-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}
#ac-left-window .ac-left-widget p,
#ac-left-window .ac-left-widget ul,
#ac-left-window .ac-left-widget form {
    margin: 0 0 8px;
}
#ac-left-window .ac-left-widget a {
    color: #367bb7;
    text-decoration: none;
}
#ac-left-window .ac-left-widget a:hover {
    color: #1a5a9a;
    text-decoration: underline;
}
#ac-left-window .ac-left-widget .tagcloud a.current-item,
#ac-left-window .ac-left-widget .tagcloud a.current-item:hover,
#ac-left-window .ac-left-widget .tagcloud a.current-item:focus,
#ac-left-window .ac-left-widget .tagcloud a:hover,
#ac-left-window .ac-left-widget .tagcloud a:focus {
    color: #ffffff !important;
    text-decoration: none;
}
#ac-left-window .mwai-custom-resize-handle {
    border-radius: 0;
}

body.ac-left-panel-open {
    overflow: hidden;
}

@media (max-width: 1299px) {
    #ac-left-window.ac-left-open {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }
    #ac-left-window.ac-left-open.ac-left-fullscreen {
        top: 5px !important;
        bottom: 56px !important;
        height: auto !important;
        max-height: none !important;
        z-index: 999999;
    }
    .admin-bar #ac-left-window.ac-left-open.ac-left-fullscreen {
        top: 37px !important;
        height: auto !important;
        max-height: none !important;
    }
    #ac-left-window.ac-left-open .ac-left-window-box {
        border-radius: 0;
    }
    #ac-left-window .mwai-custom-resize-handle {
        display: none !important;
    }
    #ac-left-window .ac-left-resize-button {
        display: none !important;
    }
}

@media (max-width: 760px) {
    #ac-left-window.ac-left-open.ac-left-fullscreen {
        bottom: calc(56px + env(safe-area-inset-bottom)) !important;
    }
}

/* Reserve space at the bottom of the page so content isn't hidden */
body { padding-bottom: 56px; }

@media (max-width: 760px) {
    body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}
