/* Schemify CPT Admin Styles */

@font-face {
    font-family: 'Shabnam';
    src: url('../fonts/Shabnam-FD.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Shabnam';
    src: url('../fonts/Shabnam-Bold-FD.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* CSS Custom Properties for repeated values */
:root {
    --color-primary: #ff6432;
    --color-red: #ef2707;
    --color-dark-gray: rgb(41, 41, 41);
    --color-white: rgb(255, 255, 255);
    --color-light-gray: #ddd;
    --color-bg-light: #eee;
    --color-bg-lighter: #f0f2f5;
    --color-table-even: #f5f7fa;
    --color-bg-button: #ffe4d4;
    --color-border-warning: #ff9d71;
    --color-text-warning: #7e1510;
    --color-text-dark: #333;
    --color-text-gray: rgb(107, 107, 107);
    --color-text-darker: #292929;
    --color-blue: #105ce9;
    --color-pink: #e90663;
    --color-green: #04b91d;
    --color-green-shadow: #02e620;
    --font-family: 'Shabnam', Arial, sans-serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semi: 600;
    --font-weight-bold: 700;
    --border-radius-small: 5px;
    --border-radius-medium: 8px;
    --border-radius-large: 12px;
    --font-size-small: 12px;
    --font-size-sm: 14px;
    --font-size-base: 15px;
    --font-size-md: 16px;
}

/* --- Modern Preloader Styles --- */
#schemify-preloader {
    height: 100vh;
    position: fixed; /* Changed from fixed to absolute */
    top: 0;
    left: 0;
    right: 160px;
    bottom: 0;
    background-color: #fff;
    z-index: 999; /* z-index can be lower now */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

/* Responsive adjustment for the preloader position */
@media screen and (max-width: 782px) {
    #schemify-preloader {
        left: 0;
    }
}

/* The container for the bouncing bars */
.schemify-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
}

/* The individual bouncing bars */
.schemify-loader div {
    display: block;
    width: 6px;
    height: 100%;
    margin: 0 4px;
    background: var(--color-primary);
    border-radius: 4px;
    animation: bouncing-loader 1.2s infinite ease-in-out;
}

/* Animation delay for each bar to create the wave effect */
.schemify-loader div:nth-child(2) {
    animation-delay: -1.1s;
}
.schemify-loader div:nth-child(3) {
    animation-delay: -1.0s;
}
.schemify-loader div:nth-child(4) {
    animation-delay: -0.9s;
}

@keyframes bouncing-loader {
    0%, 40%, 100% {
        transform: scaleY(0.4);
    }
    20% {
        transform: scaleY(1.0);
    }
}

body[class*="page_schemify"] .button:focus,
body[class*="page_schemify"] input:focus,
body[class*="page_schemify"] select:focus,
body[class*="page_schemify"] textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
    outline: 1px solid transparent; /* Hides the default browser outline */
}

#schemify-video-shortcode-button-copy {
    height: 40px;
    background-color: var(--color-primary) !important;
    border: 1px solid var(--color-primary) !important;
    border-radius: var(--border-radius-small);
    color: var(--color-white);
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 9px;
}
/* Admin Styles */
#schemify_video_metabox h2 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold);
}
.video-source-box { display: none; }
.schemify-video-metabox-wrapper h1,
.schemify-video-metabox-wrapper h2,
.schemify-video-metabox-wrapper h3,
.schemify-video-metabox-wrapper h4,
.schemify-video-metabox-wrapper h5,
.schemify-video-metabox-wrapper h6 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold);
}
.schemify-video-metabox-wrapper {font-family: var(--font-family); }
.schemify-video-metabox-wrapper p { margin-bottom: 15px; }
.schemify-video-shortcode-copy { display: flex; align-items: center; }
.schemify-video-shortcode-copy input { flex: 1; margin-right: 5px; }
.schemify-video-preview-box {
    background: #f9f9f9;
    border: 1px solid var(--color-light-gray);
    padding: 15px;
    border-radius: var(--border-radius-medium);
    min-height: 100px;
}

.schemify-video-metabox-wrapper .schemify-icon-box{
    font-size: 15px;
    font-weight: 700;
}

.schemify-video-metabox{
    display: flex;
    gap: 20px;
}

.schemify-metabox-section{
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid #ddd;
    padding: 16px;
    border-radius: 8px;
}

.schemify-metabox-section p{
    margin: 0 !important;
}

.schemify-metabox-section .schemify-media-uploader{
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.schemify-metabox-section .schemify-form-group, .schemify-metabox-section .schemify-radio-group, .schemify-metabox-section .video-source-box{
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schemify-metabox-section #schemify_video_upload_video_button{
    color: var(--color-red) !important;
    border: none !important;
    align-content: center;
    text-align: center;
    border-radius: var(--border-radius-small) !important;
    background-color: var(--color-bg-button) !important;
}
.schemify-form-group#schemify-enabled-cptv{
    color: var(--color-text-warning);
    padding: 10px 0;
}
#schemify-enabled-cptv input{
    margin-bottom: -3px;
}

.schemify-metabox-section .schemify-form-group-inline{
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: space-between;
}

.schemify-metabox-section .schemify-form-group-inline .schemify-form-group{
    width: 50%;
}

.schemify-metabox-section #schemify_video_upload_thumbnail_button{
    color: var(--color-red) !important;
    border: none !important;
    align-content: center;
    text-align: center;
    border-radius: var(--border-radius-small) !important;
    background-color: var(--color-bg-button) !important;
}

.schemify-shortcode-box{
    background-color: #f5f1f0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    padding-bottom: 0px;
    border-radius: 8px;
}

.schemify-shortcode-copy{
    display: flex !important;
    flex-direction: row;
    gap: 6px;
}
.schemify-shortcode-copy button{
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold) !important;
    height: 40px;
    background-color: var(--color-primary) !important;
    border: 1px solid var(--color-primary) !important;
    border-radius: var(--border-radius-small) !important;
    color: var(--color-white);
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 9px;
}

.schemify-video-content-wrapper{
    display: flex;
    gap: 12px;
    flex-direction: column;
    width: 65%;
}
.schemify-video-preview-wrapper{
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 35%;
}
.schemify-video-preview-box .schemify-video-responsive-embed{
    height: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
}
/* Frontend and Shared Styles */
.schemify-video-wrapper {
    display: block;
    max-width: 100%;
    margin: 0 auto;
}

.schemify-video-responsive-embed {
    position: relative;
    height: 0;
    overflow: hidden;
}

/* Horizontal (16:9) */
.schemify-video-responsive-embed.aspect-horizontal {
    padding-bottom: 56.25%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden; 
}

/* Vertical (9:16) */
.schemify-video-responsive-embed.aspect-vertical {
    max-width: 275px;
    height: 480px;
    max-height: 100%;
    margin: 0 auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 0px;
    overflow: hidden;
}
.schemify-video-responsive-embed.aspect-vertical video {
    height: unset;
}
.schemify-video-responsive-embed iframe,
.schemify-video-responsive-embed video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none; /* Remove any borders */
}

.schemify-video-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 10; /* Changed from 1 to a higher value */
}