/* TubeBay Product Metabox Styles - Classic WordPress Design */

/* ==========================================================================
   Sidebar Metabox Panel (mirrors WooCommerce Product Image)
   ========================================================================== */
.tubebay-metabox-wrapper {
    padding: 0;
}

.tubebay-hidden {
    display: none !important;
}

#tubebay-video-thumbnail-container {
    margin-bottom: 10px;
}

#tubebay-video-thumbnail-container img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.tubebay-video-title-text {
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
    margin: 0 0 6px 0;
    word-break: break-word;
}

.tubebay-video-link-actions {
    margin: 0 0 10px 0;
    font-size: 13px;
}

.tubebay-video-link-actions a {
    text-decoration: underline;
    cursor: pointer;
}

.tubebay-video-link-actions a.delete {
    color: #b32d2e;
}

.tubebay-video-link-actions a.delete:hover {
    color: #a00;
}

.tubebay-sep {
    color: #dcdcde;
}

#tubebay-add-video-container a {
    cursor: pointer;
    text-decoration: underline;
}

/* Autoplay options */
#tubebay-autoplay-setting {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dcdcde;
}

#tubebay-autoplay-setting label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    cursor: pointer;
}

#tubebay-autoplay-setting .description {
    margin: 4px 0 0 0;
    font-style: italic;
}


/* ==========================================================================
   WordPress Media Modal Wrapper & Body Layout
   ========================================================================== */
#tubebay-video-modal {
    position: fixed;
    z-index: 159900;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Standard WP Media Modal Overrides */
#tubebay-video-modal .media-modal {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
    height: calc(100% - 80px);
    top: 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
}

#tubebay-video-modal .media-modal-content {
    border-radius: 8px;
    overflow: hidden;
}

#tubebay-video-modal .media-modal-close {
    border-top-right-radius: 8px;
}

/* Make search inputs look native in the media toolbar */
#tubebay-video-modal .media-toolbar-primary.search-form {
    max-width: 260px;
}

/* Flexbox Layout inside Attachments Browser */
#tubebay-video-modal .attachments-browser {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Remove Absolute Positioning from Media Toolbar */
#tubebay-video-modal .attachments-browser .media-toolbar {
    position: relative !important;
}

/* Grid body fills the rest of the space and scrolls independently */
.tubebay-modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f0f0f1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    align-content: start; /* Prevents rows from stretching vertically to fill the height */
}

.tubebay-modal-video-item {
    cursor: pointer;
    border: 2px solid #c3c4c7;
    border-radius: 6px;
    background: #fff;
    overflow: visible;
    transition: border-color 0.1s;
    box-sizing: border-box;
}

.tubebay-modal-video-item:hover {
    border-color: #2271b1;
}

.tubebay-modal-video-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.tubebay-modal-video-item p {
    margin: 0;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tubebay-loading-text {
    grid-column: 1 / -1;
    text-align: center;
    color: #646970;
    padding: 40px 0;
    font-size: 13px;
}.tubebay-list-item:hover {
    border-color: #2271b1 !important;
}
.tubebay-gallery-settings p {
    margin-bottom: 8px;
    margin-top: 0;
}
.tubebay-gallery-settings label {
    font-size: 12px;
    color: #646970;
}
