/* Override theme's space-between to keep schedule button next to dropdown */
.socialv-whats-new-options {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5em;
    justify-content: space-between !important;
    /* Override theme's space-between */
}

.schedule-mode-dropdown .schedule-mode-option {
    font-size: 14px;
    padding: 0.5rem 1rem;
}

/* Push POST button to the right, but keep schedule button on the left */


.whats-new-schedule-submit {
    position: relative;
    display: inline-flex;
    margin: 0;
    vertical-align: middle;
    align-items: center;
    gap: 1.5em;
}

.whats-new-schedule-submit .socialv-scheduler-wrapper {
    display: inline-flex;
    align-items: center;
}

.whats-new-schedule-submit .socialv-scheduler-wrapper .schedule-btn,
#buddypress .whats-new-schedule-submit .socialv-scheduler-wrapper .schedule-btn {
    background: var(--global-body-bgcolor);
    border: 1px solid var(--border-color-light);
    color: var(--global-font-title);
    padding: .5rem 1em;
    text-transform: capitalize;
    letter-spacing: 0;
}

/* Schedule Mode Dropdown Styles */
.schedule-mode-dropdown {
    position: relative;
    display: inline-block;
}

#buddypress .schedule-mode-toggle {
    background: var(--global-body-bgcolor);
    border: 1px solid var(--border-color-light);
    color: var(--global-font-title);
    padding: .4rem 0.8em;
    font-size: 13px;
    text-transform: capitalize;
    letter-spacing: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5em;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 130px;
    justify-content: space-between;
}

#buddypress .schedule-mode-toggle:hover {
    background: var(--color-theme-white-box);
    border-color: var(--color-theme-primary);
}

#buddypress .schedule-mode-toggle i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.schedule-mode-dropdown.active .schedule-mode-toggle i {
    transform: rotate(180deg);
}

.socialv-scheduler-picker-container .components-input-control__backdrop {
    border-color: var(--border-color-light) !important;
}

#buddypress .components-datetime__date div {
    color: var(--global-font-title);
}

#buddypress .components-datetime__date button.components-button.components-datetime__date__day {
    padding: .3rem;
    background: transparent;
}

.socialv-whats-new-options .components-text {
    color: var(--global-font-color);
}

#buddypress button.components-button {
    background: var(--global-body-bgcolor);
    color: var(--global-font-title);
    padding: .3rem;
}

span.components-datetime__time-separator {
    border: none;
}

#buddypress button.components-button svg {
    fill: var(--global-font-title);
}

.schedule-mode-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: var(--color-theme-white-box);
    border: 1px solid var(--border-color-light);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 999;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.schedule-mode-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5em;
    color: var(--global-font-title);
    transition: background 0.2s ease;
}

.schedule-mode-option:hover {
    background: var(--color-theme-primary-light, rgba(56, 88, 249, 0.1));
}

.schedule-mode-dropdown .schedule-mode-option.selected {
    background: var(rgba(56, 88, 249, 0.1));
    color: var(--color-theme-primary);
    font-weight: 600;
}

.schedule-mode-option i {
    font-size: 16px;
}

/* ========================================
   WordPress DateTimePicker Custom Styles
   ======================================== */

/* Time input fields */
.components-datetime__time-legend {
    font-weight: 600;
    color: var(--global-font-title);
    margin-bottom: 0.5em;
}

.socialv-scheduler-wrapper .components-input-control__container {
    box-sizing: unset !important;
    background: var(--color-theme-white-box);
}

.socialv-scheduler-wrapper .css-jedafn.css-jedafn.css-jedafn {
    background: var(--color-theme-white-box);
    color: var(--global-font-title);
}

.socialv-scheduler-picker-container .components-toggle-group-control {
    background: var(--global-body-bgcolor);
    border-color: var(--border-color-light);
}

.socialv-scheduler-picker-container .components-toggle-group-control::before {
    background: var(--color-theme-white-box);
}

.socialv-scheduler-picker-container .components-toggle-group-control .css-1abtnze .css-1lmqqds {
    color: var(--global-font-title);
}

.socialv-scheduler-picker-container .components-input-base {
    color: var(--global-font-title);
}

/* Main DateTimePicker container */
.components-datetime {
    font-family: inherit;
}

/* Calendar header (month/year navigation) */
.components-datetime__calendar {
    background: var(--color-theme-white-box);
    border: 1px solid var(--border-color-light);
    border-radius: 8px;
    padding: 1em;
}

.components-datetime__date-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color-light);
    padding-bottom: 0.5em;
    margin-bottom: 0.5em;
}

/* Month/Year buttons */
.components-datetime__date-header button {
    color: var(--color-theme-primary);
    font-weight: 600;
}

.components-datetime__date-header button:hover {
    background: var(--color-theme-primary-light, rgba(56, 88, 249, 0.1));
}

/* Calendar grid */
.components-datetime__date {
    border-collapse: separate;
    border-spacing: 4px;
}

/* Day cells */
.components-datetime__date__day {
    color: var(--color-theme-body-color);
    border-radius: 4px;
    font-size: 14px;
}

.components-datetime__date__day:hover {
    background: var(--color-theme-primary-light, rgba(56, 88, 249, 0.1));
    color: var(--color-theme-primary);
}

/* Selected/Today */
.components-datetime__date__day.components-button.is-selected,
.components-datetime__date__day.components-button[aria-selected="true"] {
    background-color: var(--color-theme-primary) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: none !important;
    border: 1px solid var(--color-theme-primary) !important;
}

.components-datetime__date__day.components-button.is-today.is-selected {
    background-color: var(--color-theme-primary) !important;
    color: #ffffff !important;
}

.components-datetime__date__day.components-button.is-selected:hover {
    background-color: var(--color-theme-primary-dark) !important;
    color: #ffffff !important;
}

.components-datetime__date__day.components-button:not(.is-selected):hover {
    background-color: var(--color-theme-primary-light, rgba(56, 88, 249, 0.1)) !important;
    color: var(--color-theme-primary) !important;
}

.components-datetime__date__day.is-today {
    border: 2px solid var(--color-theme-primary);
}

/* Disabled days (past dates) */
.components-datetime__date__day:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Time picker section */



.components-datetime__time-field-hours-input:focus,
.components-datetime__time-field-minutes-input:focus {
    border-color: var(--color-theme-primary);
    outline: none;
    box-shadow: 0 0 0 1px var(--color-theme-primary);
}

/* AM/PM buttons */
.components-datetime__time-field-am-pm button {
    background: transparent;
    border: 1px solid var(--border-color-light);
    border-radius: 4px;
    padding: 0.5em 1em;
    color: var(--color-theme-body-color);
    font-size: 14px;
}

.components-datetime__time-field-am-pm button.is-primary {
    background: var(--color-theme-primary);
    color: var(--color-theme-white);
    border-color: var(--color-theme-primary);
}

/* Timezone display */
.components-datetime__timezone {
    font-size: 12px;
    color: var(--global-body-lightcolor);
    margin-top: 0.5em;
}

/* Picker container wrapper */
.socialv-scheduler-picker-container .components-datetime {
    width: 100%;
}

.socialv-scheduler-picker-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-theme-white-box);
    z-index: 9;
    min-width: 600px;
    padding: 1em;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    border: 1px solid var(--light-border-color);

    /* animation base */
    transform: translateY(0) scale(1);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.components-toggle-group-control {
    background: var(--color-theme-white-box);
}

.css-1j4kpro::before {
    background-color: var(--global-font-title);
}

.socialv-activity-option-wrapper {
    position: relative;
}

.socialv-activity-submenu-wrapper {
    display: none;
    position: absolute;
    right: 0;
    top: 28px;
    background: var(--color-theme-white-box);
    padding: 10px 0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

.socialv-activity-submenu-wrapper.active {
    display: block;
}

.socialv_activity_inner,
.socialv-activity-inner,
.activity-content,
.socialv-activity-parent {
    overflow: visible !important;
}

#sv-edit-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    padding: 40px 20px;
    box-sizing: border-box;
}

#sv-edit-modal .sv-modal-box {
    background: var(--color-theme-white-box);
    max-width: 820px;
    margin: 0 auto;
    border-radius: 8px;
    padding: 18px;
    max-height: 86vh;
    overflow: auto;
    position: relative;
}

#sv-edit-modal .sv-modal-close {
    position: absolute;
    right: 12px;
    top: 8px;
    font-size: 22px;
    cursor: pointer;
}

.sv-edit-existing-media img {
    width: 84px;
    height: 84px;
    object-fit: cover;
    margin: 6px;
    border-radius: 6px;
}

.sv-edit-row {
    margin-bottom: 12px;
}

.sv-edit-media-item {
    position: relative;
    display: inline-block;
    margin: 5px;
}

.sv-edit-media-item img {
    max-width: 120px;
    border-radius: 6px;
}

/* Video, audio and document previews */
.sv-media-video {
    max-width: 160px;
    max-height: 120px;
    border-radius: 6px;
    display: block;
    margin: 6px;
}

.sv-media-audio {
    display: block;
    width: 220px;
    margin: 10px 6px;
}

.sv-media-doc {
    display: flex;
    align-items: center;
    max-width: 220px;
    margin: 6px;
    padding: 6px 8px;
    border: 1px solid var(--border-color-light);
    border-radius: 6px;
    background: var(--global-body-lightcolor);
    font-size: 14px;
}

.sv-doc-icon {
    margin-right: 8px;
    font-size: 18px;
}

.sv-edit-remove-media {
    position: absolute;
    top: 2px;
    right: 2px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: var(--color-theme-white);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    padding: 0;
    line-height: 20px;
}

.socialv-schedule-edit {
    background: transparent;
    border: none;
    color: var(--color-theme-primary);
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    padding: 0;
    line-height: 1;
}

.socialv-schedule-edit:hover {
    color: var(--color-theme-primary-dark);
}

.socialv-schedule-info {
    border: 1px solid var(--border-color-light);
    padding: .5rem;
    margin-top: 1rem;
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.socialv-schedule-info span strong {
    color: var(--global-font-title);
}

#buddypress .socialv-schedule-controls {
    display: flex;
    align-items: center;
    gap: .5rem;
}

#buddypress .socialv-schedule-controls button.socialv-schedule-edit {
    padding: 0;
    height: 2rem;
    width: 2rem;
    line-height: 2rem;
    text-align: center;
    color: var(--color-theme-primary);
    border: 1px solid var(--color-theme-primary);
    background: var(--color-theme-primary-light);
}

#buddypress .socialv-schedule-controls button.socialv-schedule-cancel {
    padding: 0;
    height: 2rem;
    width: 2rem;
    line-height: 2rem;
    text-align: center;
    color: var(--color-theme-danger);
    border: 1px solid var(--color-theme-danger);
    background: var(--color-theme-danger-light);
}

/* edit */
.socialv-scheduler-picker-container.socialv-scheduler-picker-custom {
    position: static;
    padding: .5rem;
}

.components-input-control__container .components-select-control__input {
    background: var(--global-body-bgcolor) !important;
}

.socialv-scheduler-picker-container .components-input-control__container {
    background: var(--global-body-bgcolor) !important;
    color: var(--global-title-color) !important;
}

.socialv-scheduler-picker-container .components-input-control__input {
    color: var(--global-title-color) !important;
}

.components-text {
    color: var(--global-title-color) !important;
}

/* ========================================
   SweetAlert2 Customization Override
   ======================================== */
/* Uncomment and change these values to customize the design */
/*
:root {
    --swal2-background: #ffffff;
    --swal2-color: #545454;
    --swal2-border-radius: 10px;
    --swal2-width: 32em;
}

div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm) {
    background-color: var(--color-theme-primary) !important; 
    color: #fff !important;
}

div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel) {
    background-color: #6e7881 !important;
    color: #fff !important;
}

div:where(.swal2-container) h2:where(.swal2-title) {
    font-size: 1.5rem !important;
    color: var(--global-font-title) !important;
}
*/
/* Force SweetAlert2 Cancel button to be Red */

/* ========================================
   Initialization Loader
   ======================================== */
.whats-new-schedule-submit:empty {
    min-height: 40px;
    display: flex;
    align-items: center;
}

.whats-new-schedule-submit:empty::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color-light, #eaebf0);
    border-radius: 50%;
    border-top-color: var(--color-theme-primary, #3858f9);
    animation: socialv-spin 0.8s linear infinite;
    margin-right: 10px;
}

.whats-new-schedule-submit:empty::after {
    content: "Loading...";
    font-size: 14px;
    color: var(--global-font-title, #1f1f1f);
    font-weight: 500;
}

@keyframes socialv-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Infinite Scroll Loader */
.socialv-schedule-loader {
    padding: 1rem 0;
    color: var(--global-font-title);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.socialv-schedule-loader .icon-spin {
    font-size: 30px;
    color: var(--color-theme-primary);
    animation: socialv-spin 1s linear infinite;
    display: inline-block;
}