/* ==========================================================================
   MW TIMEZONE WIDGETS
   Toggle, Notice, and Time Display Styles
   ========================================================================== */

/* ==========================================================================
   TIMEZONE TOGGLE WIDGET
   ========================================================================== */

.mw-timezone-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mw-timezone-toggle__switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.mw-timezone-toggle__input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.mw-timezone-toggle__slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cccccc;
    transition: background-color 0.3s ease;
    border-radius: 26px;
}

.mw-timezone-toggle__slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: transform 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.mw-timezone-toggle__input:checked + .mw-timezone-toggle__slider {
    background-color: #2F31FC;
}

.mw-timezone-toggle__input:checked + .mw-timezone-toggle__slider:before {
    transform: translateX(22px);
}

.mw-timezone-toggle__input:focus + .mw-timezone-toggle__slider {
    box-shadow: 0 0 0 2px rgba(47, 49, 252, 0.3);
}

.mw-timezone-toggle__label {
    color: #000000;
    font-size: 16px;
    line-height: 1.4;
    cursor: pointer;
}

@media (min-width: 768px) {
    .mw-timezone-toggle__label {
        font-size: 18px;
    }
}

/* ==========================================================================
   TIMEZONE NOTICE WIDGET
   ========================================================================== */

.mw-timezone-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background-color: #f0f4ff;
    border: 1px solid #2F31FC;
    border-radius: 4px;
}

.mw-timezone-notice__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mw-timezone-notice__icon svg {
    width: 18px;
    height: 18px;
    fill: #2F31FC;
}

.mw-timezone-notice__text {
    color: #333333;
    font-size: 14px;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .mw-timezone-notice__text {
        font-size: 16px;
    }
}

.mw-timezone-notice__timezone {
    color: #2F31FC;
    font-weight: 600;
}

/* ==========================================================================
   EVENT TIME DISPLAY (STACKED FORMAT)
   ========================================================================== */

/* Base time display - common to all widgets */
.mw-event-time {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Local time (user's timezone) - shown on top */
.mw-event-time__local {
    display: none; /* Hidden by default, shown via JS when converted */
    font-weight: 500;
}

/* London time - always visible */
.mw-event-time__london {
    display: block;
}

/* When showing converted time, style London time as secondary */
.mw-event-time--converted .mw-event-time__local {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.mw-event-time--converted .mw-event-time__local::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12,6 12,12 16,14'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.mw-event-time--converted .mw-event-time__london {
    font-size: 0.75em;
    color: #666666;
}

.mw-event-time--converted .mw-event-time__london::before {
    content: "London: ";
}

/* ==========================================================================
   SHOW CLOCK ICON OPTION
   When enabled, always show clock icon on the primary time display
   ========================================================================== */

/* Clock icon base styles - always visible when element exists */
.mw-event-time__primary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    flex-shrink: 0;
}

.mw-event-time__primary-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* When show-icon is enabled, make london time flex for alignment */
.mw-event-time--show-icon .mw-event-time__london {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* When converted with show-icon, local already has icon via ::before, hide the inline icon in london */
.mw-event-time--show-icon.mw-event-time--converted .mw-event-time__london {
    display: block;
}

.mw-event-time--show-icon.mw-event-time--converted .mw-event-time__london .mw-event-time__primary-icon {
    display: none;
}

/* ==========================================================================
   WIDGET-SPECIFIC TIME STYLING
   ========================================================================== */

/* Featured Event Widget */
.mw-featured-event__time.mw-event-time {
    color: #000000;
    font-size: 16px;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .mw-featured-event__time.mw-event-time {
        font-size: 18px;
    }
}

.mw-featured-event__time.mw-event-time--converted .mw-event-time__london {
    font-size: 13px;
}

@media (min-width: 768px) {
    .mw-featured-event__time.mw-event-time--converted .mw-event-time__london {
        font-size: 14px;
    }
}

/* Event Loop Item Widget */
.mw-event-loop-item__time.mw-event-time {
    color: #000000;
    font-size: 16px;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .mw-event-loop-item__time.mw-event-time {
        font-size: 18px;
    }
}

.mw-event-loop-item__time.mw-event-time--converted .mw-event-time__london {
    font-size: 13px;
}

@media (min-width: 768px) {
    .mw-event-loop-item__time.mw-event-time--converted .mw-event-time__london {
        font-size: 14px;
    }
}

/* Event Series Block Widget */
.mw-event-series__event-details.mw-event-time {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    vertical-align: top;
}

.mw-event-series__event-details.mw-event-time--converted .mw-event-time__london {
    font-size: 0.75em;
}

/* ==========================================================================
   TIMEZONE FOOTNOTE WIDGET
   ========================================================================== */

.mw-timezone-footnote {
    font-size: 13px;
    color: #666666;
    font-style: italic;
}

@media (min-width: 768px) {
    .mw-timezone-footnote {
        font-size: 14px;
    }
}

/* ==========================================================================
   EVENT DATE TIME WIDGET
   ========================================================================== */

.mw-event-datetime {
    display: flex;
}

.mw-event-datetime--stacked {
    flex-direction: column;
}

.mw-event-datetime--inline {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
}

.mw-event-datetime__date {
    font-weight: 500;
}

.mw-event-datetime__separator {
    color: #666666;
}

.mw-event-datetime__time.mw-event-time {
    color: #000000;
    font-size: 16px;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .mw-event-datetime__time.mw-event-time {
        font-size: 18px;
    }
}

.mw-event-datetime__time.mw-event-time--converted .mw-event-time__london {
    font-size: 13px;
}

@media (min-width: 768px) {
    .mw-event-datetime__time.mw-event-time--converted .mw-event-time__london {
        font-size: 14px;
    }
}

/* ==========================================================================
   EVENT REGISTER BUTTON WIDGET
   ========================================================================== */

.mw-event-register__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

/* Reset button element defaults when used as popup trigger */
button.mw-event-register__button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.mw-event-register__button:hover {
    text-decoration: none;
}

.mw-event-register__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mw-event-register__icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}
