/**
 * Styles for the Update Later block
 */

/* Block styles */
.update-later-block {
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

/* Frontend notice when content becomes visible */
.update-later-notice {
    background-color: #f0f8ff;
    border: 1px solid #007cba;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #0073aa;
}

/* Admin-only notice styling */
.update-later-admin-notice {
    background-color: #fff8dc;
    border-color: #ffb900;
    color: #826200;
    position: relative;
}

.update-later-admin-notice::before {
    content: "👁️ Admin only: ";
    font-weight: bold;
    margin-right: 5px;
}

/* Editor styles */
.editor-styles-wrapper .update-later-block {
    padding: 20px;
    background-color: #f8f9fa;
    border: 2px solid #007cba;
    border-radius: 4px;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.2s ease;
}

.editor-styles-wrapper .update-later-block:hover {
    background-color: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Scheduler header - only visible in editor */
.editor-styles-wrapper .update-later-header {
    background-color: #007cba;
    color: white;
    padding: 8px 12px;
    font-weight: bold;
    font-size: 14px;
    border-radius: 3px 3px 0 0;
    margin: -20px -20px 15px -20px;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Scheduled time display in header */
.update-later-scheduled-time {
    font-size: 12px;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 3px;
    margin-left: 10px;
    font-weight: normal;
}

/* Editor status indicator - replaces hidden overlay */
.editor-styles-wrapper .update-later-editor-status {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 15px;
    font-size: 13px;
    text-align: center;
}

.editor-styles-wrapper .update-later-editor-status-visible {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.editor-styles-wrapper .update-later-editor-status-scheduled {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.editor-styles-wrapper .update-later-editor-status-expired {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.editor-styles-wrapper .update-later-editor-status p {
    margin: 0;
    font-weight: 500;
}

/* Empty state message */
.update-later-empty-message {
    padding: 20px;
    text-align: center;
    color: #757575;
    font-style: italic;
}

/* Alignment classes */
.update-later-block.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.update-later-block.alignfull {
    max-width: 100%;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Block appender button */
.update-later-block .block-editor-button-block-appender {
    width: 100%;
    justify-content: center;
    padding: 12px;
    box-shadow: none;
    border: 1px dashed #ccc;
    background-color: transparent;
}

.update-later-block .block-editor-button-block-appender:hover {
    background-color: #f0f0f0;
    border-color: #999;
}

/* Make sure inner blocks have proper spacing */
.update-later-block > * + * {
    margin-top: 1em;
}

/* Status display in inspector */
.update-later-status {
    background-color: #f0f0f0;
    padding: 12px;
    border-radius: 4px;
    margin-top: 16px;
}

.update-later-status p {
    margin: 0;
    line-height: 1.5;
}

/* Date Time Picker Container */
.update-later-datetime-control {
    margin-top: 16px;
}

/* Fix the TIME and DATE input fields at the top - all set to 40px height for proper alignment */

/* TIME section at top */
.update-later-datetime-control .components-datetime__time-wrapper,
.update-later-datetime-control .components-datetime__time-fieldset {
    margin-bottom: 0;
}

/* Remove default alignment from time field wrapper */
.update-later-datetime-control .components-datetime__time-field-time {
    align-items: initial !important;
}

/* Time input fields */
.update-later-datetime-control .components-datetime__time-field input[type="number"] {
    width: 60px;
    height: 40px;
    text-align: center;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 8px;
    line-height: 1;
}

/* Time separator colon - make sure it aligns with 40px inputs */
.update-later-datetime-control .components-datetime__time-separator {
    height: 40px;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    line-height: 1;
}

/* AM/PM selector */
.update-later-datetime-control .components-datetime__time-field .components-datetime__time-field-am-pm select {
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    min-width: 60px;
    line-height: 1;
}

/* DATE section at top */
.update-later-datetime-control .components-datetime__date-wrapper,
.update-later-datetime-control .components-datetime__date-fieldset {
    margin-bottom: 16px;
}

/* Month dropdown */
.update-later-datetime-control .components-datetime__date select {
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    line-height: 1;
}

/* Day and Year number inputs */
.update-later-datetime-control .components-datetime__date input[type="number"] {
    width: 80px;
    height: 40px;
    text-align: center;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 8px;
    line-height: 1;
}

/* Fix the day input field component margin */
.update-later-datetime-control .components-datetime__time-field-day {
    margin-bottom: 0 !important;
}
/* Fix vertical alignment of time inputs and AM/PM toggle */
.update-later-datetime-control .components-datetime__time-wrapper .components-h-stack {
    align-items: flex-start !important;
}

/* Alternative: Target the flex container more specifically */
.update-later-datetime-control .components-flex.components-h-stack {
    align-items: flex-start !important;
}

/* If the above doesn't work, try this more specific selector */
.update-later-datetime-control .components-datetime__time-field-time.components-h-stack {
    align-items: flex-start !important;
}

/* Ensure all time-related inputs maintain consistent height
.update-later-datetime-control .components-datetime__time-field input[type="number"],
.update-later-datetime-control .components-datetime__time-separator,
.update-later-datetime-control .components-toggle-group-control {
    height: 40px;
    display: flex;
    align-items: center;
} */

/* Also fix any other date/time field components that might have extra margin */
.update-later-datetime-control .components-datetime__time-field,
.update-later-datetime-control .components-datetime__date-field {
    margin-bottom: 0 !important;
}

/* Override WordPress DateTimePicker styles for better display */
.update-later-datetime-control .components-datetime {
    margin-bottom: 0;
}

.update-later-datetime-control .components-datetime__date {
    margin-bottom: 16px;
}

.update-later-datetime-control .components-datetime__time {
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
    margin-top: 16px;
}

/* Remove border from Update Later datetime inputs specifically */
.update-later-datetime-control .components-input-control__input {
    border: none !important;
}

/* Ensure the backdrop (background) element doesn't interfere
.update-later-datetime-control .components-input-control__backdrop {
    border: none !important;
} */

/* Time field inputs in the time section */
.update-later-datetime-control .components-datetime__time-field input[type="number"] {
    width: 50px;
    text-align: center;
}

/* AM/PM selector in the time section */
.update-later-datetime-control .components-datetime__time-field-am-pm {
    margin-left: 8px;
}

.update-later-datetime-control .components-datetime__time-field-am-pm select {
    padding: 0 24px 0 8px;
}

/* Frontend hidden state - ONLY applies to frontend, not editor */
.update-later-hidden {
    display: none;
}

/* Admin preview styling for scheduled content - ONLY applies to frontend */
.update-later-admin-preview {
    position: relative;
    border: 2px dashed #ffb900;
    background-color: rgba(255, 185, 0, 0.05);
    padding: 20px;
}

.update-later-admin-preview::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #ffb900;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .update-later-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .update-later-scheduled-time {
        margin-left: 0;
        margin-top: 5px;
    }
}