/* TubeBay Product Metabox Styles */

.tubebay-metabox-wrapper {
    padding: 10px 0;
}

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

/* Video Card */
.tubebay-video-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.tubebay-video-thumbnail-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
}

.tubebay-video-thumbnail-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tubebay-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    pointer-events: none;
}

.tubebay-video-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
}

.tubebay-video-actions .button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
}

.tubebay-video-actions .tubebay-danger-btn {
    color: #dc2626;
}
.tubebay-video-actions .tubebay-danger-btn:hover {
    color: #b91c1c;
    background: #fee2e2;
}

.tubebay-video-title {
    padding: 12px 16px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Settings Rows */
.tubebay-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f3f4f6;
}
.tubebay-setting-row:last-child {
    border-bottom: none;
}

.tubebay-setting-label strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    color: #111827;
}

.tubebay-setting-label .description {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

/* Toggle Switch */
.tubebay-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}

.tubebay-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.tubebay-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.tubebay-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .tubebay-slider {
    background-color: #3b82f6;
}

input:focus + .tubebay-slider {
    box-shadow: 0 0 1px #3b82f6;
}

input:checked + .tubebay-slider:before {
    transform: translateX(16px);
}

.tubebay-slider.tubebay-round {
    border-radius: 24px;
}

.tubebay-slider.tubebay-round:before {
    border-radius: 50%;
}

/* Modal Overlay & Content */
#tubebay-video-modal {
    position: fixed;
    z-index: 100000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tubebay-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
}

.tubebay-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    background: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.tubebay-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tubebay-modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.tubebay-modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
}
.tubebay-modal-close:hover {
    color: #111827;
}

/* Filter Toolbar */
.tubebay-modal-toolbar {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 16px;
    background: #f9fafb;
}

#tubebay-modal-search {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

#tubebay-modal-sort {
    width: 180px;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

/* Modal Body */
.tubebay-modal-body {
    padding: 24px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.tubebay-modal-video-item {
    cursor: pointer;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.tubebay-modal-video-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #3b82f6;
}

.tubebay-modal-video-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.tubebay-modal-video-item p {
    margin: 0;
    padding: 10px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tubebay-loading-text {
    grid-column: 1 / -1;
    text-align: center;
    color: #6b7280;
    padding: 40px 0;
}

/* Modal Footer */
.tubebay-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    background: #f9fafb;
    border-radius: 0 0 8px 8px;
}

#tubebay-modal-load-more {
    width: 200px;
    font-weight: 600;
}
