/* ============================================================
   ALB'S — Scheduled sending (Gmail-style chevron + popover)
   ============================================================ */

/* Make formbuttons a positioning context for the popover */
.formbuttons {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* The chevron button stuck to the right of "Envoyer" */
#ss-chevron.ss-chevron {
    background: linear-gradient(135deg, #E95421 0%, #FF7043 100%) !important;
    border: none !important;
    border-left: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 0 6px 6px 0 !important;
    color: #fff !important;
    padding: 0.6rem 0.55rem !important;
    margin-left: -0.4rem !important;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(233, 84, 33, 0.25) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: auto;
    min-width: 0;
}

#ss-chevron .ss-chevron-icon {
    font-size: 0.85rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

#ss-chevron:hover {
    background: linear-gradient(135deg, #FF7043 0%, #E95421 100%) !important;
    box-shadow: 0 4px 14px rgba(233, 84, 33, 0.35) !important;
}

#ss-chevron[aria-expanded="true"] .ss-chevron-icon {
    transform: rotate(180deg);
}

/* Make Envoyer button stick visually to the chevron */
.formbuttons .btn.btn-primary.send {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    margin-right: 0 !important;
}

/* The bar — hidden by default when used as popover */
#ss-inline-schedule.ss-row.ss-popover {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 1000;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(36, 46, 74, 0.98) 0%, rgba(42, 52, 84, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    min-width: 280px;
    animation: ss-popover-in 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

#ss-inline-schedule.ss-row.ss-popover.ss-open {
    display: flex;
}

@keyframes ss-popover-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Arrow pointing down to the chevron */
#ss-inline-schedule.ss-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 24px;
    border: 7px solid transparent;
    border-top-color: rgba(42, 52, 84, 0.98);
}

#ss-inline-schedule .ss-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
    font-size: 0.78rem;
    color: #8F9BB3;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

#ss-inline-schedule #ss-when {
    background: rgba(26, 32, 53, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 6px !important;
    color: #E0E6ED !important;
    padding: 0.55rem 0.75rem !important;
    font-size: 0.92rem !important;
    font-family: inherit !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color-scheme: dark;
    width: 100%;
    box-sizing: border-box;
}

#ss-inline-schedule #ss-when:focus {
    border-color: #E95421 !important;
    box-shadow: 0 0 0 3px rgba(233, 84, 33, 0.15) !important;
    outline: none !important;
    background: rgba(26, 32, 53, 0.9) !important;
}

#ss-inline-schedule #ss-when::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.6);
    cursor: pointer;
}

#ss-inline-schedule #ss-schedule-btn {
    background: linear-gradient(135deg, #E95421 0%, #FF7043 100%) !important;
    border: none !important;
    border-radius: 6px !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    padding: 0.55rem 1rem !important;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(233, 84, 33, 0.3) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
}

#ss-inline-schedule #ss-schedule-btn::before {
    content: "\f1d8";
    font-family: "Icons";
    font-weight: 900;
    font-size: 0.9em;
}

#ss-inline-schedule #ss-schedule-btn:hover {
    background: linear-gradient(135deg, #FF7043 0%, #E95421 100%) !important;
    box-shadow: 0 4px 14px rgba(233, 84, 33, 0.4) !important;
    transform: translateY(-1px);
}

#ss-inline-schedule #ss-schedule-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Sidebar listing icon for the "scheduled" folder */
.listing.iconized tr.scheduled_sending > td.section:before {
    content: "\f017";
}
