﻿/* ============================================================================
   Genesis Checkbox Component
   ========================================================================== */

.genesis-checkbox {
    display: none !important;
}

.genesis-checkbox-label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin: 8px 0;
}

.genesis-checkbox-box {
    position: relative;
    flex: 0 0 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #9098A9;
    transition: all 0.2s ease;
    margin-right: 8px;
}

    .genesis-checkbox-box svg {
        position: absolute;
        top: 3px;
        left: 2px;
        fill: none;
        stroke: #FFFFFF;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-dasharray: 16px;
        stroke-dashoffset: 16px;
        transition: all 0.3s ease;
        transition-delay: 0.1s;
    }

.genesis-checkbox-label:hover .genesis-checkbox-box {
    border-color: #506EEC;
}

.genesis-checkbox:checked + .genesis-checkbox-label .genesis-checkbox-box {
    animation: gen-checkbox-wave 0.4s ease;
    background: linear-gradient(var(--base-btn-bg-angle), rgba(var(--base-btn-bg-color1), 1) 0%, rgba(var(--base-btn-bg-color2), 1) 100%);
    border-color: rgba(var(--base-btn-borders-hover), 1);
}

    .genesis-checkbox:checked + .genesis-checkbox-label .genesis-checkbox-box svg {
        stroke-dashoffset: 0;
    }

@keyframes genesis-checkbox-wave {
    50% {
        transform: scale(0.9);
    }
}


.calendar-cell {
    position: relative;
    vertical-align: top;
    padding: 6px;
}



/* Wrapper for event cards */
.calendar-card-wrapper {
    position: absolute;
    top: 26px; /* space below date */
    left: 4px;
    right: 4px;
    bottom: 30px; /* space above add button */
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    z-index: 2;
}

.usn_cmp_calendaredit .modal.hidden, 
.usn_cmp_calendar .modal.hidden {
        display: none;
}

.usn_cmp_calendaredit .modal,
.usn_cmp_calendar .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.usn_cmp_calendaredit .modal-content,
.usn_cmp_calendar .modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 350px;
}

.calendar-grid td {
    position: relative;
    width: calc(100% / 7);
    aspect-ratio: 1 / 1;
    vertical-align: top;
    border: 1px solid #ccc;
    overflow: hidden;
}

.calendar-cell {
    height: 100%;
    padding: 4px;
    box-sizing: border-box;
}

.calendar-grid td::before {
    content: "";
    display: block;
    padding-top: 100%; /* height = width */
}

/* Date number */
.calendar-cell-date {
    position: absolute;
    top: 6px;
    left: 6px;
    font-weight: 600;
    font-size: 14px;
    z-index: 2;
}

.calendar-cell {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

    .calendar-cell.is-today {
        background-color: rgba(0, 120, 255, 0.1);
        border-color: #0078ff;
    }

    .calendar-cell.is-outside {
        opacity: 0.5;
    }


/*------------------------------------------------------------
    Calendar Overlays / Popouts â€” Common Styles
------------------------------------------------------------*/

:root {
    --modal-padding: 20px;
}

.usn_cmp_calendaredit .modal,
.usn_cmp_calendar .modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55); /* slightly softer overlay */
    backdrop-filter: blur(4px); /* gentle blur for focus */
    z-index: 9999;
}

.usn_cmp_calendaredit #new-event-modal.modal:not(.lightbox) .modal-content,
.usn_cmp_calendar #new-event-modal.modal:not(.lightbox) .modal-content {
    width: fit-content;
    padding: var(--modal-padding);
    border-radius: calc(var(--base-border-radius) + var(--modal-padding));
    background: rgba(255, 255, 255, 0.85); /* more opaque for legibility */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); /* adds depth */
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/*------------------------------------------------------------
    Calendar â€” Editor Layout
------------------------------------------------------------*/

.usn_cmp_calendaredit .modal-content .editor-grid,
.usn_cmp_calendar .modal-content .editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.editor-left,
.editor-right {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* spacing between field groups */
}

.usn_cmp_calendaredit .modal-content .form-field[data-required="true"] > label::after,
.usn_cmp_calendar .modal-content .form-field[data-required="true"] > label::after {
    content: " *";
    color: red;
    font-weight: bold;
}

.usn_cmp_calendaredit .modal-content .editor-actions,
.usn_cmp_calendar .modal-content .editor-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.usn_cmp_calendaredit .modal-footer,
.usn_cmp_calendar .modal-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

    /* Top row: full width */
    .usn_cmp_calendaredit .modal-footer .btn-row.top,
    .usn_cmp_calendar .modal-footer .btn-row.top {
        display: flex;
        width: 100%;
    }

        .usn_cmp_calendaredit .modal-footer .btn-row.top .btn,
        .usn_cmp_calendar .modal-footer .btn-row.top .btn {
            flex: 1;
            height: 56px;
        }

    /* Bottom row: ratio split */
    .usn_cmp_calendaredit .modal-footer .btn-row.bottom,
    .usn_cmp_calendar .modal-footer .btn-row.bottom {
        display: grid;
        grid-template-columns: 1fr auto; /* left fills remaining space, right fits content */
        gap: 12px;
        width: 100%;
        max-width: 100%; /* keeps alignment consistent */
    }

        .usn_cmp_calendaredit .modal-footer .btn-row.bottom .btn,
        .usn_cmp_calendar .modal-footer .btn-row.bottom .btn {
            height: 56px;
            font-weight: 700;
            display: flex;
            justify-content: center;
            align-items: center;
        }


.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem; /* tighter labelâ€“input spacing */
}

    .form-field label {
        font-weight: 600;
        margin-bottom: 0.1rem;
    }

    .form-field input,
    .form-field textarea,
    .form-field select {
        padding: 0.5rem;
        border: 1px solid var(--uui-color-border, #ccc);
        border-radius: 4px;
    }

.validation-message {
    font-size: 0.8rem;
    color: var(--uui-color-danger, #e74c3c);
    min-height: 1em; /* keeps layout stable even when empty */
}



.usn_cmp_calendaredit .modal-content .save-btn,
.usn_cmp_calendar .modal-content .save-btn {
    background: #4caf50;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
}

.usn_cmp_calendaredit .modal-content .cancel-btn,
.usn_cmp_calendar .modal-content .cancel-btn {
    background: #999;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
}

.visibility-toggle {
    display: inline-flex;
    gap: 8px;
}

.visibility-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--uui-color-border, #ccc);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    background: #f7f7f7;
    color: #000;
}

    .visibility-option span {
        font-weight: 600;
    }

/* Hide native radios */
.visibility-toggle input[type="radio"] {
    display: none;
}

    /* Apply checked state to the label */
    .visibility-toggle input[type="radio"]:checked + label {
        background: var(--uui-color-positive, #2ecc71);
        color: #fff;
        border-color: var(--uui-color-positive, #2ecc71);
        box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    }

.edit-btn {
    margin-left: 8px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--uui-color-border, #ccc);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .edit-btn:hover {
        background: var(--uui-color-positive, #2ecc71);
        color: #fff;
    }

.hidden {
    display: none;
}

.validation-message {
    font-size: 0.8rem;
    color: var(--uui-color-danger, #e74c3c);
    min-height: 1em;
    margin-top: 0.15rem;
}

.global-error-message {
    background: rgba(231, 76, 60, 0.1);
    color: var(--uui-color-danger, #e74c3c);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.usn_cmp_calendaredit .calendar-event,
.usn_cmp_calendar .calendar-event {
    position: relative;
}

.usn_cmp_calendaredit .event-actions,
.usn_cmp_calendar .event-actions {
    display: inline-flex;
    align-items: stretch;
    position: absolute;
    top: 4px;
    right: 4px;
    gap: 0px;
    background: transparent;
    border: none;
    padding: 2px 6px;
}

.calendar-card .event-actions {
    opacity: 0;
}

.calendar-card:hover .event-actions {
    opacity: 1;
}

.event-actions .event-bttn {
    border: none;
    color: #222; /* dark neutral for icons */
    background-color: #d0d0d0; /* light silver-gray */
    vertical-align: text-bottom;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2em;
    height: 1.125em;
    padding: 0 0.1em;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

    .event-actions .event-bttn:hover {
        background-color: #b0b0b0; /* medium silver-gray hover */
        box-shadow: 0 0 3px rgba(0, 0, 0, 0.25);
    }

    .event-actions .event-bttn.event-delete:hover {
        background-color: #e57373; /* subtle red accent for delete */
    }

    .event-actions .event-bttn.event-edit:hover {
        background-color: #64b5f6; /* soft blue accent for edit */
    }


    .event-actions .event-bttn.event-delete,
    .event-actions .event-bttn.event-edit {
        width: 1.5em;
    }

    .event-actions .event-bttn.event-edit {
        border-radius: 0.5625em 0 0 0.5625em;
        padding: 0 0.1em 0 0.5em;
    }

    .event-actions .event-bttn.event-delete {
        border-radius: 0 0.5625em 0.5625em 0;
        padding: 0 0.5em 0 0.1em;
        color: red;
    }

.calendar-actions {
    display: inline-flex;
    align-items: stretch;
    position: absolute;
    bottom: 6px;
    right: 6px;
    gap: 2px;
    background: transparent;
    border: none;
    padding: 2px 6px;
}

/* Add & paste button */
.calendar-add-bttn,
.calendar-paste-bttn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: 700;
    text-align: center;
    line-height: 22px;
    cursor: pointer;
    z-index: 4;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    opacity: 0.1;
    transition: opacity 0.2s ease;
}

.calendar-add-bttn {
    background-color: var(--uui-color-positive, #2ecc71);
    color: #fff;
}

.calendar-paste-bttn {
    background-color: var(--uui-color-positive, #2ecc71);
    color: #fff;
    padding: 0 0.2em 0.2em 0.2em;
}


.calendar-cell:hover .calendar-add-bttn,
.calendar-cell:hover .calendar-paste-bttn {
    opacity: 1;
}


.event-actions button.event-delete {
    border-radius: 0 50% 50% 0;
    color: red;
    padding: 0 0.5em 0 0.1em;
}

.event-actions button.event-edit {
    border-radius: 50% 0 0 50%;
    padding: 0 0.1em 0 0.5em;
}

button.slick-autoplay-toggle-button {
    visibility: hidden;
}


/* Base style for recurrence day buttons */
.recurrence-day {
    border: 1px solid var(--base-btn-borders);
    background-color: transparent;
    color: var(--base-btn-text);
    transition: all 0.2s ease;
}

    /* Hover effect */
    .recurrence-day:hover {
        background-color: rgba(var(--base-btn-bg-color1), 0.1);
    }

    /* Selected state */
    .recurrence-day.selected {
        background: linear-gradient(var(--base-btn-bg-angle), rgba(var(--base-btn-bg-color1), 1) 0%, rgba(var(--base-btn-bg-color2), 1) 100%);
        color: #fff;
        border-color: rgba(var(--base-btn-borders-hover), 1);
    }

.recurrence-day {
    border: 1px solid var(--base-btn-borders);
    background-color: transparent;
    color: var(--base-btn-text);
    transition: all 0.2s ease;
}

    .recurrence-day.selected {
        background: linear-gradient(var(--base-btn-bg-angle), rgba(var(--base-btn-bg-color1), 1) 0%, rgba(var(--base-btn-bg-color2), 1) 100%);
        color: #fff;
        border-color: rgba(var(--base-btn-borders-hover), 1);
    }
