/**
 * Site Popup - Frontend Styles
 *
 * Displays on the public website for maintenance/closure notices.
 */

/* Popup Container */
.em-site-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Backdrop */
.em-site-popup__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

/* Main Container */
.em-site-popup__container {
    position: relative;
    max-width: 500px;
    width: 90%;
    background: #fff;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: em-popup-slide-in 0.3s ease-out;
}

@keyframes em-popup-slide-in {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button */
.em-site-popup__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.em-site-popup__close:hover {
    color: #333;
}

/* Icon */
.em-site-popup__icon {
    margin-bottom: 20px;
}

.em-site-popup__icon .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
}

/* Template-specific icon colors */
.em-site-popup--maintenance .em-site-popup__icon .dashicons {
    color: #f0ad4e;
}

.em-site-popup--emergency .em-site-popup__icon .dashicons {
    color: #d9534f;
}

.em-site-popup--custom .em-site-popup__icon .dashicons {
    color: #73CDD6;
}

/* Title */
.em-site-popup__title {
    margin: 0 0 16px;
    font-size: 28px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.3;
}

/* Message */
.em-site-popup__message {
    font-size: 16px;
    color: #50575e;
    line-height: 1.7;
    margin-bottom: 0;
}

.em-site-popup__message p {
    margin: 0 0 12px;
}

.em-site-popup__message p:last-child {
    margin-bottom: 0;
}

/* Schedule/Resolution time */
.em-site-popup__schedule {
    font-size: 14px;
    color: #888;
    margin: 24px 0 0;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Custom HTML container */
.em-site-popup__custom {
    text-align: left;
}

/* Hidden state */
.em-site-popup--hidden {
    display: none !important;
}

/* Custom raw HTML - reset wrapper styles so custom HTML has full control */
.em-site-popup--custom-raw {
    display: block;
    position: static;
    font-family: inherit;
    text-align: inherit;
}

/* Responsive */
@media screen and (max-width: 480px) {
    .em-site-popup__container {
        width: 95%;
        padding: 30px 20px;
        border-radius: 8px;
    }

    .em-site-popup__icon .dashicons {
        font-size: 48px;
        width: 48px;
        height: 48px;
    }

    .em-site-popup__title {
        font-size: 22px;
    }

    .em-site-popup__message {
        font-size: 15px;
    }

    .em-site-popup__close {
        font-size: 28px;
        top: 8px;
        right: 12px;
    }
}

/* Template-specific border accents */
.em-site-popup--maintenance .em-site-popup__container {
    border-top: 4px solid #f0ad4e;
}

.em-site-popup--emergency .em-site-popup__container {
    border-top: 4px solid #d9534f;
}

.em-site-popup--custom .em-site-popup__container {
    border-top: 4px solid #73CDD6;
}

/* Password-protected popup (locked) */
.em-site-popup--locked .em-site-popup__backdrop {
    cursor: default;
}

/* Staff Access */
.em-site-popup__staff-access {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.em-site-popup__staff-link {
    background: none;
    border: none;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.em-site-popup__staff-link:hover {
    color: #555;
}

/* Password Form */
.em-site-popup__password-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: 12px;
}

.em-site-popup__password-input {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 180px;
    font-family: inherit;
}

.em-site-popup__password-input:focus {
    outline: none;
    border-color: #73CDD6;
    box-shadow: 0 0 0 2px rgba(115, 205, 214, 0.2);
}

.em-site-popup__password-submit {
    padding: 10px 20px;
    background: #1d2327;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.em-site-popup__password-submit:hover {
    background: #2c3338;
}

.em-site-popup__password-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.em-site-popup__password-error {
    width: 100%;
    margin: 8px 0 0;
    color: #d9534f;
    font-size: 13px;
}

/* Blocking overlay for password-protected custom HTML popups */
.em-site-popup__block-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: transparent;
    cursor: not-allowed;
}

/* Floating Staff Access for Custom HTML popups */
.em-site-popup__staff-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10002;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
}

.em-site-popup__staff-float .em-site-popup__password-form {
    margin-top: 8px;
}

.em-site-popup__staff-float .em-site-popup__password-input {
    width: 140px;
}

@media screen and (max-width: 480px) {
    .em-site-popup__staff-float {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .em-site-popup__staff-float .em-site-popup__password-input {
        width: 100%;
    }
}
