/* Reduce native WordPress spacing between Title and Metabox */
body.post-type-reelshive #post-body-content {
    margin-bottom: 0 !important;
}

body.post-type-reelshive #titlediv {
    margin-bottom: 10px !important;
}

body.post-type-reelshive #postbox-container-2 {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.post-type-reelshive .edit-post-meta-boxes-area {
    margin-top: 5px !important;
}

/* Main Wrapper */
.reelshive-meta-wrapper {
    padding: 15px;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Global Button Reset for ReelsHive */
.reelshive-meta-wrapper button,
.reelshive-fullscreen-overlay button {
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none;
}

/* Two Column Layout */
.reelshive-two-col {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.reelshive-settings-col {
    flex: 1;
    min-width: 0;
}

.reelshive-preview-col {
    width: 260px;
    flex-shrink: 0;
    background: #fcfcfc;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #e2e4e7;
    position: sticky;
    top: 32px;
    max-height: calc(100vh - 80px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.reelshive-preview-col label {
    display: block;
    margin-bottom: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reelshive-field-group {
    margin-bottom: 15px;
}

.reelshive-field-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #1d2327;
}

/* Tab System */
.reelshive-tabs-wrapper {
    margin-top: 25px;
    border: 1px solid #e2e4e7;
    border-radius: 10px;
    overflow: visible;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.reelshive-tabs-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e4e7;
}

.reelshive-tab-btn {
    padding: 10px 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #646970;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    border-right: 1px solid #e2e4e7;
    outline: none !important;
}

.reelshive-tab-btn:hover {
    color: #2271b1;
    background: #fff;
}

.reelshive-tab-btn.active {
    color: #2271b1 !important;
    background: #fff;
    border-bottom: 3px solid #2271b1;
    padding-bottom: 11px;
}

.reelshive-tabs-content {
    padding: 15px;
    min-height: 480px;
}

.reelshive-tab-panel {
    display: none;
    animation: reelshiveFadeIn 0.3s ease;
}

@keyframes reelshiveFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reelshive-tab-panel.active {
    display: block !important;
    overflow: visible !important;
}

/* Customization Fields Layout */
.reelshive-tab-panel .reelshive-field-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f1;
}

.reelshive-tab-panel .reelshive-field-group:last-child {
    border-bottom: none;
}

.reelshive-tab-panel .reelshive-field-group>label {
    width: 150px;
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 600;
}

.reelshive-toggle-wrapper {
    min-width: 92px;

}

.reelshive-two-col-fields {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid #eee;
}

.reelshive-two-col-fields .reelshive-field-group {
    flex: 1;
    border-bottom: none;
    padding: 15px 0;
}

.reelshive-two-col-fields .reelshive-field-group label {
    width: auto;
    display: block;
    margin-bottom: 8px;
}

/* Simple Native Color Picker Styling */
.reelshive-color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reelshive-color-picker {
    width: 40px !important;
    height: 35px !important;
    padding: 0 !important;
    border: 1px solid #ccd0d4 !important;
    border-radius: 4px !important;
    cursor: pointer;
    background: none !important;
}

.reelshive-color-hex {
    width: 100px !important;
    text-transform: uppercase;
    font-family: monospace;
    font-size: 13px !important;
}

/* Ensure parents don't clip any native overlays if they exist */
.reelshive-tab-panel,
.reelshive-two-col-fields {
    overflow: visible !important;
}

/* Video Source Styling */
.reelshive-video-source-container {
    padding: 20px;
    background: #fcfcfc;
    border: 1px dashed #ccd0d4;
    border-radius: 8px;
    margin-bottom: 20px;
}

.reelshive-source-toggle {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.reelshive-toggle-option {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.reelshive-input-with-button {
    display: flex;
    gap: 10px;
    align-items: center;
}

.reelshive-input-with-button input {
    flex-grow: 1;
    font-size: 14px;
}

/* Shared Player Styles */
.reelshive-frontend-player {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    position: relative;
    line-height: 0;
}

.reelshive-preview-wrapper {
    position: relative;
    width: 100%;
    /* strictly maintain 9:16 vertical video ratio */
    aspect-ratio: 9 / 16 !important;
    margin: 0 auto;
    overflow: hidden;
}

.reelshive-video-preview-inner-shared {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reelshive-preview-video-element-shared {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

/* Sidebar & Buttons */
.reelshive-preview-actions-sidebar {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.reelshive-preview-wrapper:hover .reelshive-preview-actions-sidebar {
    opacity: 1;
    pointer-events: auto;
}

.reelshive-preview-share-btn,
.reelshive-preview-mute-btn,
.reelshive-preview-fullscreen-btn {
    width: 42px;
    height: 42px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    border: none;
    text-decoration: none !important;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;

    box-sizing: border-box;

    /* Hardware-accelerated transitions */
    transition:
        transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.reelshive-preview-share-btn:hover,
.reelshive-preview-mute-btn:hover,
.reelshive-preview-fullscreen-btn:hover {
    transform: scale(1.2) translateZ(0);
    background: transparent;
}

.reelshive-preview-share-btn:active,
.reelshive-preview-mute-btn:active,
.reelshive-preview-fullscreen-btn:active {
    transform: scale(0.95) translateZ(0);
    transition-duration: 0.1s;
}

.reelshive-preview-share-btn .dashicons,
.reelshive-preview-mute-btn .dashicons,
.reelshive-preview-fullscreen-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
}

/* Progress Bar */
.reelshive-reel-progress-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 110;
    opacity: 0;
    transition: all 0.3s ease;
}

.reelshive-preview-wrapper:hover .reelshive-reel-progress-container,
.reelshive-reel-progress-container.is-dragging {
    height: 8px;
    opacity: 1;
}

.reelshive-reel-progress-bar {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Success State for Share */
.reelshive-preview-share-btn.success .dashicons {
    color: #46b450;
}

/* No Video State */
.reelshive-no-video-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: #888;
    min-height: 500px;
    background: #111;
}

.reelshive-no-video-selected .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
}

/* Embed Container */
.reelshive-embed-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.reelshive-embed-container iframe {
    max-width: 100%;
    max-height: 100%;
    border: none;
}

/* Hide WP Default UI */
.post-type-reelshive #titlediv,
.post-type-reelshive #edit-slug-box,
.post-type-reelshive #screen-meta-links {
    display: none !important;
}

/* Hide move up/down and close/toggle controls on the Video Details metabox */
#reelshive_video .handlediv,
#reelshive_video .handle-order-higher,
#reelshive_video .handle-order-lower {
    display: none !important;
}

/* Hide default WP "Add New" button original position â€” relocated via JS into the action bar */
.post-type-reelshive .wrap>h1>.page-title-action {
    display: none;
}

/* Prevent collapse cursor hint on Video Details metabox header */
#reelshive_video .hndle {
    cursor: default;
}

/* Header Actions Styles (formerly inline) */
.reelshive-header-actions {
    background: #fff;
    margin: 8px 0 12px 0;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #dcdcde;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.reelshive-page-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #1d2327;
    line-height: 1.2;
}

.reelshive-header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 8px;
}

.reelshive-add-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    background: #f0f6fb;
    color: #2271b1;
    border: 1px solid #c3d9ed;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
    margin: 0;
    vertical-align: middle;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.reelshive-add-new-btn:hover {
    background: #ddeaf6;
    border-color: #2271b1;
    color: #135e96;
}

.reelshive-add-new-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.reelshive-header-main-flex {
    display: flex;
    gap: 20px;
    align-items: flex-end;
}

.reelshive-guide-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #2271b1;
    text-decoration: none;
    padding: 5px 12px;
    background: #f0f6fb;
    border: 1px solid #c3d9ed;
    border-radius: 5px;
    transition: all 0.2s ease;
    height: 28px;
    line-height: 1;
}

.reelshive-guide-link:hover {
    background: #ddeaf6;
    border-color: #2271b1;
    color: #135e96;
}

.reelshive-guide-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.reelshive-header-title-section {
    flex: 1;
}

.reelshive-header-title-section label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    color: #646970;
    margin-bottom: 4px;
    letter-spacing: 0.6px;
}

.reelshive-header-shortcode-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.reelshive-header-shortcode-section label {
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 700;
    color: #646970;
    letter-spacing: 0.8px;
    margin: 0;
}

.reelshive-header-title-input {
    width: 100%;
    height: 34px !important;
    border-radius: 5px !important;
    border: 1px solid #8c8f94 !important;
    font-size: 13px !important;
    padding: 0 10px !important;
    transition: border-color 0.2s ease;
}

.reelshive-header-title-input:focus {
    border-color: #2271b1 !important;
    box-shadow: 0 0 0 1px #2271b1 !important;
}

.reelshive-header-shortcode-pill {
    background: #f0f6fb;
    padding: 0 12px;
    height: 38px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    border: 1px solid #cce0f0;
    min-width: 200px;
}

.reelshive-header-shortcode-pill code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-weight: 600;
    color: #2271b1;
    background: none;
    cursor: pointer;
    font-size: 13px;
    transition: transform 0.1s ease;
    position: relative;
}

.reelshive-header-shortcode-pill code.copied {
    color: #46b450;
}

.reelshive-pill-placeholder {
    color: #8c8f94;
    font-style: italic;
    font-size: 12px;
}

.reelshive-header-save-btn {
    height: 46px;
    padding: 0 25px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.reelshive-header-save-btn:hover {
    background: #135e96;
}

.reelshive-header-save-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin: 0;
}

.reelshive-metabox-save-container {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.reelshive-header-status-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f0f1;
    padding: 6px 12px;
    border-radius: 60px;
}

.reelshive-header-status-toggle .status-label {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    min-width: 60px;
}

.reelshive-metabox-save-btn {
    height: 34px;
    padding: 0 20px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
    box-shadow: 0 2px 4px rgba(34, 113, 177, 0.2);
}

.reelshive-metabox-save-btn:hover {
    background: #135e96;
    color: #fff;
}

.reelshive-metabox-save-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Hide default WP elements */
.post-type-reelshive #titlediv,
.post-type-reelshive #wpbody-content>.wrap>h1 {
    display: none !important;
}

/* CTA Overlay Styles */
.reelshive-cta-overlay {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none;
    padding: 0 20px;
    box-sizing: border-box;
}

.reelshive-cta-button {
    pointer-events: auto;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-shadow: none !important;
    text-decoration: none !important;
    white-space: nowrap;
    gap: 8px;

    /* Dedicated property transitions for buttery smoothness */
    transition:
        background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Anti-aliasing boost for cleaner transforms */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* Default: Elegant Pill (White) */
    color: #333333;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Base hover matches Elegant Pill level */
.reelshive-cta-button:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    background-color: #f9f9f9;
    color: #2271b1 !important;
    /* Blue color on hover */
}

.reelshive-cta-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.reelshive-cta-button:hover .reelshive-cta-inner {
    transform: scale(1.05) translateZ(0);
}

/* Variant 2: Modern Outline (White) */
.reelshive-cta-button.reelshive-outline-white {
    color: #ffffff;
    background-color: transparent;
    border: 2px solid #ffffff;
    box-shadow: none;
}

.reelshive-cta-button.reelshive-outline-white:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #2271b1;
}

/* Variant 3: Impactful Dark */
.reelshive-cta-button.reelshive-solid-dark {
    color: #ffffff;
    background-color: #1a1a1a;
    border: 1px solid #333333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.reelshive-cta-button.reelshive-solid-dark:hover {
    background-color: #333333;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    color: #2271b1;
}

.reelshive-cta-button:active {
    transform: scale(0.98);
}

/* Remove black border/focus outline on click */
.reelshive-cta-button:focus,
.reelshive-cta-button:active {
    outline: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.reelshive-cta-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    transition: none;
    /* Transition handled by .reelshive-cta-inner */
}

/* Toggle Switch */
.reelshive-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reelshive-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

.reelshive-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.reelshive-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccd0d4;
    transition: .4s;
    border-radius: 20px;
}

.reelshive-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.reelshive-slider {
    background-color: #2271b1;
}

input:focus+.reelshive-slider {
    box-shadow: 0 0 1px #2271b1;
}

input:checked+.reelshive-slider:before {
    transform: translateX(14px);
}

/* Information Icons & Tooltips */
.reelshive-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 10px;
    height: 10px;
    background: #2271b1;
    color: #fff;
    border-radius: 50%;
    font-size: 7px;
    font-family: serif;
    font-style: italic;
    font-weight: bold;
    cursor: help;
    margin-left: 3px;
    vertical-align: super;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    top: -1px;
    line-height: 1;
}

.reelshive-info-icon:hover {
    background: #135e96;
}

.reelshive-info-icon .reelshive-tooltip {
    visibility: hidden;
    width: 180px;
    background-color: #32373c;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1000;
    bottom: 150%;
    left: 50%;
    margin-left: -90px;
    opacity: 0;
    transition: opacity 0.3s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 11px;
    font-style: normal;
    line-height: 1.4;
    pointer-events: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-transform: none;
    font-weight: normal;
}

.reelshive-info-icon .reelshive-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #32373c transparent transparent transparent;
}

.reelshive-info-icon:hover .reelshive-tooltip {
    visibility: visible;
    opacity: 1;
}

/* ============================================================
   Sortable Gallery List (gallery-meta-box.php)
   ============================================================ */
.reelshive-manage-sortable-list {
    margin: 0;
    padding: 15px;
    list-style: none;
    background: #f9f9f9;
    border: 1px dashed #ccd0d4;
    min-height: 100px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.reelshive-manage-sortable-list .sortable-item {
    float: left;
    /* Needed for jQuery UI sortable in grids */
    background: #fff;
    border: 1px solid #ccd0d4;
    margin-bottom: 0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
    width: 130px;
    border-radius: 8px;
}

.reelshive-manage-sortable-list .sortable-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.reelshive-manage-sortable-list .drag-handle {
    position: absolute;
    top: 5px;
    left: 5px;
    cursor: grab;
    color: #2271b1;
    font-size: 20px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.reelshive-manage-sortable-list .drag-handle:active {
    cursor: grabbing;
}

.reelshive-manage-sortable-list .item-thumb {
    width: 100%;
    aspect-ratio: 9/16;
    background: #000;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    pointer-events: none;
}

.reelshive-manage-sortable-list .item-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.reelshive-manage-sortable-list .item-info {
    font-size: 12px;
    font-weight: 500;
    color: #1d2327;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 4px;
    margin-top: 0;
}

.reelshive-manage-sortable-list .item-actions {
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 20;
}

.reelshive-manage-sortable-list .remove-list-item {
    width: 24px;
    height: 24px;
    background: #d63638;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 0;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    text-decoration: none;
}

.reelshive-manage-sortable-list .sortable-item:hover .remove-list-item {
    opacity: 1;
}

.reelshive-manage-sortable-list .remove-list-item:hover {
    background: #b32d2e;
    transform: scale(1.1);
}

.reelshive-sortable-placeholder {
    border: 2px dashed #2271b1 !important;
    background: #f0f7ff !important;
    visibility: visible !important;
    height: 260px;
    width: 130px;
    margin-bottom: 0;
    border-radius: 8px;
}

.reelshive-manage-sortable-list .reelshive-sortable-sentinel {
    width: 130px;
    height: 260px;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
    border: none;
}

/* ============================================================
   Gallery Meta Wrapper (gallery-meta-box.php)
   ============================================================ */
.reelshive-gallery-meta-wrapper .full-width {
    width: 100%;
}

.reelshive-tab-content {
    display: none;
}

.reelshive-tab-content.active {
    display: block;
}

.reelshive-layout-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.reelshive-layout-option input {
    display: none;
}

.reelshive-layout-option .reelshive-layout-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 80px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9f9f9;
    font-size: 11px;
}

.reelshive-layout-option input:checked+.reelshive-layout-box {
    border-color: #2271b1;
    background: #f0f7ff;
    color: #2271b1;
}

.reelshive-layout-box .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-bottom: 6px;
}

.reelshive-reels-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    margin-top: 10px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.reelshive-short-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.reelshive-short-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.reelshive-short-item.selected {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px #2271b1;
}

.reelshive-short-item input[type="checkbox"] {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.reelshive-short-item-content {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    background: #111;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reelshive-short-item-content img,
.reelshive-short-item-content video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.reelshive-short-item-placeholder {
    width: 100%;
    height: 100%;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.reelshive-short-item-placeholder .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
}

.reelshive-short-item-preview-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 5;
}

.reelshive-short-item-content:hover .reelshive-short-item-preview-btn {
    opacity: 1;
}

.reelshive-short-item-preview-btn:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: translate(-50%, -50%) scale(1.1);
}

.reelshive-short-item-preview-btn .dashicons {
    color: #fff;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.reelshive-short-item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 6px 6px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
    text-align: center;
    z-index: 4;
}

.reelshive-uploaded-video-item {
    position: relative;
}

.reelshive-remove-uploaded-video {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 15;
    width: 22px;
    height: 22px;
    background: rgba(220, 50, 50, 0.85);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}

.reelshive-remove-uploaded-video:hover {
    background: rgba(200, 30, 30, 1);
}

.reelshive-sub-tab-btn {
    transition: all 0.2s ease;
}

.reelshive-sub-tab-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #2271b1;
}

.reelshive-sub-tab-btn.active {
    background: #fff !important;
    color: #2271b1;
}

/* ============================================================
   Admin List - Shortcode Column (class-reelshive-admin.php)
   ============================================================ */
.column-shortcode code {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 4px;
    background: #f0f6fb;
    border: 1px solid #cce0f0;
    color: #2271b1;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
}

.column-shortcode code:hover {
    background: #ddeaf6;
    border-color: #2271b1;
}

.column-shortcode code.copied {
    color: #46b450;
    border-color: #46b450;
    background: #ecf7ed;
}

.column-shortcode code.copied::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 1px;
    border-width: 0 5px 5px 5px;
    border-style: solid;
    border-color: transparent transparent #46b450 transparent;
    z-index: 10;
}

/* ============================================================
   How-to Guide Page (how-to-guide.php)
   ============================================================ */
.reelshive-guide-wrapper {
    margin: 20px 20px 0 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1a1a1a;
}

.reelshive-guide-header {
    background: #2271b1;
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.15);
}

.reelshive-guide-header-inner {
    display: flex;
    align-items: center;
    gap: 15px;
}

.reelshive-guide-logo {
    background: rgba(255, 255, 255, 0.15);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reelshive-guide-logo .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.reelshive-guide-title h1 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.reelshive-guide-title p {
    margin: 2px 0 0;
    font-size: 13px;
    opacity: 0.85;
}

.reelshive-guide-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.reelshive-guide-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e5e5;
}

.reelshive-guide-card h2,
.reelshive-guide-card h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2271b1;
}

.reelshive-guide-card.quick-start {
    border-left: 5px solid #2271b1;
}

.reelshive-guide-step {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.reelshive-step-number {
    background: #f0f6fb;
    color: #2271b1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.reelshive-step-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.reelshive-step-text p {
    margin: 0;
    color: #646970;
}

.reelshive-guide-grid,
.shortcode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.reelshive-shortcode-item {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
}

.reelshive-shortcode-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #2271b1;
}

.reelshive-shortcode-label .dashicons {
    font-size: 20px;
}

.reelshive-shortcode-simple-code {
    background: #f6f7f7;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 4px solid #c3c4c7;
    margin-bottom: 12px;
}

.reelshive-shortcode-simple-code code {
    background: transparent !important;
    color: #1a1a1a !important;
    padding: 0 !important;
    font-size: 14px;
    font-weight: 600;
}

.reelshive-shortcode-note {
    margin: 0;
    font-size: 13px;
    color: #646970;
}

.reelshive-guide-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.reelshive-tab-pane {
    display: none;
}

.reelshive-tab-pane.active {
    display: block;
}

.reelshive-doc-table {
    width: 100%;
    margin-top: 15px;
    border-collapse: collapse;
}

.reelshive-doc-table td {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: top;
}

.reelshive-doc-table tr:last-child td {
    border-bottom: none;
}

.reelshive-opt-name {
    font-weight: 700;
    width: 200px;
    color: #1a1a1a;
}

.reelshive-opt-desc {
    color: #646970;
    line-height: 1.5;
}

.reelshive-doc-section h4 {
    margin: 25px 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
    color: #2271b1;
}

.reelshive-section-intro {
    color: #646970;
    margin: 0 0 20px;
    font-size: 14px;
}

.reelshive-copyable-code {
    cursor: copy;
    transition: all 0.2s ease;
    display: inline-block;
    position: relative;
    padding: 6px 10px !important;
}

.reelshive-copyable-code:hover {
    background: #e5eff5 !important;
    border-color: #2271b1;
}

.reelshive-copyable-code.is-copied::after {
    content: 'Copied!';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
}

.reelshive-doc-code {
    display: block;
    background: #1a1a1a;
    color: #00ff00;
    padding: 15px;
    border-radius: 8px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    margin: 15px 0;
}

@media (max-width: 900px) {
    .reelshive-guide-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Responsiveness for Meta Boxes */
@media screen and (max-width: 782px) {
    .reelshive-two-col {
        flex-direction: column;
        gap: 30px;
    }

    .reelshive-preview-col {
        width: 260px !important; /* Unified with Desktop for perfect height visibility */
        max-width: 260px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        position: relative !important;
        top: 0 !important;
        margin-top: 20px;
        box-sizing: border-box;
        padding: 0 !important;
        max-height: none !important; /* SOLVED: Removes vertical clipping */
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .reelshive-preview-wrapper {
        aspect-ratio: 9 / 16 !important;
        height: auto !important;
        max-height: none !important;
    }

    .reelshive-settings-col {
        width: 100% !important;
    }

    .reelshive-metabox-save-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .reelshive-tabs-nav {
        flex-direction: column;
    }

    .reelshive-tab-btn {
        border-right: none !important;
        border-bottom: 1px solid #e2e4e7 !important;
        width: 100% !important;
        justify-content: flex-start;
        padding: 12px 16px !important;
    }

    /* Guide Responsive */
    .reelshive-guide-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .reelshive-guide-tabs {
        flex-direction: column;
        width: 100%;
    }

    .reelshive-guide-tabs .reelshive-tab-btn {
        width: 100%;
        text-align: left;
    }

    /* Admin Header Responsive */
    .reelshive-header-top-row {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px !important;
    }

    .reelshive-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .reelshive-header-title-section {
        width: 100% !important;
    }

    .reelshive-header-title-input {
        font-size: 18px !important;
    }

    /* Responsive Tables in Documentation */
    .reelshive-doc-table,
    .reelshive-doc-table tbody,
    .reelshive-doc-table tr,
    .reelshive-doc-table td {
        display: block !important;
        width: 100% !important;
    }

    .reelshive-doc-table tr {
        margin-bottom: 15px;
        border-bottom: 1px solid #eee;
        padding-bottom: 10px;
    }

    .reelshive-doc-table td {
        padding: 4px 0 !important;
        border: none !important;
    }

    .reelshive-opt-name {
        font-weight: 700;
        color: #2271b1;
    }

    /* Shortcode Grid Responsive */
    .shortcode-grid.simple {
        grid-template-columns: 1fr !important;
    }

    .tips-grid {
        grid-template-columns: 1fr !important;
    }

    .reelshive-tab-panel .reelshive-field-group {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .reelshive-tab-panel .reelshive-field-group>label {
        width: 100% !important;
    }

    .reelshive-input-with-button {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
    }

    .reelshive-input-with-button input {
        width: 100% !important;
    }

    .reelshive-input-with-button button {
        width: 100% !important;
        margin-top: 5px;
    }

    /* Always show action icons and progress bar on mobile touch devices */
    .reelshive-preview-actions-sidebar,
    .reelshive-reel-progress-container {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Match fullscreen controls design to normal view on mobile */
    .reelshive-fullscreen-action-btn {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .reelshive-fullscreen-action-btn .dashicons {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9)) !important;
    }

    /* Immersive Fullscreen for Mobile - No Cropping */
    .reelshive-fullscreen-overlay .reelshive-fullscreen-video {
        width: 100vw !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100dvh !important;
        object-fit: contain !important;
        /* NO CROPPING, NO STRETCHING */
        background: transparent !important;
        /* REPLACES BLACK BARS WITH BLURRED BG */
        border-radius: 12px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
        aspect-ratio: 9 / 16 !important;
    }

    .reelshive-layout-toggle-group {
        gap: 10px !important;
    }

    .reelshive-layout-option {
        flex: 1;
        min-width: calc(33.333% - 10px);
    }

    .reelshive-layout-option .reelshive-layout-box {
        width: 100% !important;
        height: 70px !important;
        font-size: 10px !important;
    }
}