/* Site Wide Announcements - Frontend Styles */

.swa-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: none;
    justify-content: center;
    align-items: center;
}

.swa-overlay.swa-active {
    display: flex;
}

/* Base popup styles */
.swa-popup {
    background-color: var(--swa-popup-bg, #ffffff);
    color: var(--swa-popup-text, #333333);
    width: var(--swa-popup-width, 500px);
    height: var(--swa-popup-height, auto);
    border-radius: var(--swa-border-radius, 8px);
    box-shadow: var(--swa-box-shadow, 0 10px 30px rgba(0,0,0,0.3));
    font-size: var(--swa-font-size, 16px);
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s ease;
}

.swa-popup.swa-visible {
    transform: scale(1);
    opacity: 1;
}

/* Modal popup */
.swa-popup.swa-modal {
    position: relative;
}

/* Banner popup */
.swa-popup.swa-banner {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    position: fixed;
    left: 0;
    transform: translateY(-100%);
}

.swa-popup.swa-banner.swa-top {
    top: 0;
}

.swa-popup.swa-banner.swa-bottom {
    bottom: 0;
    transform: translateY(100%);
}

.swa-popup.swa-banner.swa-visible {
    transform: translateY(0);
}

/* Slide-in popup */
.swa-popup.swa-slide-in {
    position: fixed;
    width: 350px;
    height: auto;
    transform: translateX(100%);
}

.swa-popup.swa-slide-in.swa-top-right,
.swa-popup.swa-slide-in.swa-bottom-right {
    right: 20px;
}

.swa-popup.swa-slide-in.swa-top-left,
.swa-popup.swa-slide-in.swa-bottom-left {
    left: 20px;
    transform: translateX(-100%);
}

.swa-popup.swa-slide-in.swa-top-right,
.swa-popup.swa-slide-in.swa-top-left {
    top: 20px;
}

.swa-popup.swa-slide-in.swa-bottom-right,
.swa-popup.swa-slide-in.swa-bottom-left {
    bottom: 20px;
}

.swa-popup.swa-slide-in.swa-visible {
    transform: translateX(0);
}

/* Corner notification */
.swa-popup.swa-corner {
    position: fixed;
    width: 300px;
    height: auto;
    border-radius: var(--swa-border-radius, 8px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform: scale(0.8) translateY(20px);
}

.swa-popup.swa-corner.swa-top-right {
    top: 20px;
    right: 20px;
}

.swa-popup.swa-corner.swa-top-left {
    top: 20px;
    left: 20px;
}

.swa-popup.swa-corner.swa-bottom-right {
    bottom: 20px;
    right: 20px;
}

.swa-popup.swa-corner.swa-bottom-left {
    bottom: 20px;
    left: 20px;
}

.swa-popup.swa-corner.swa-visible {
    transform: scale(1) translateY(0);
}

/* Position specific styles for overlay-based popups */
.swa-overlay .swa-popup.swa-top {
    align-self: flex-start;
    margin-top: 50px;
}

.swa-overlay .swa-popup.swa-bottom {
    align-self: flex-end;
    margin-bottom: 50px;
}

.swa-overlay .swa-popup.swa-center {
    align-self: center;
}

/* Content styles */
.swa-content {
    padding: 30px;
}

.swa-title {
    margin: 0 0 15px 0;
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

.swa-message {
    margin-bottom: 20px;
    line-height: 1.6;
}

.swa-message p {
    margin: 0 0 10px 0;
}

.swa-message p:last-child {
    margin-bottom: 0;
}

.swa-actions {
    text-align: center;
    margin-top: 25px;
}

/* Close button */
.swa-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
}

.swa-close-btn:hover {
    background-color: rgba(0,0,0,0.1);
    color: #666;
    transform: scale(1.1);
}

/* Dismiss button */
.swa-dismiss-btn {
    background-color: var(--swa-button-bg, #007cba);
    color: var(--swa-button-text, #ffffff);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.swa-dismiss-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0.9;
}

.swa-dismiss-btn:active {
    transform: translateY(0);
}

/* Animation classes */
.swa-fadeIn {
    animation: swaFadeIn 0.4s ease-out;
}

.swa-slideDown {
    animation: swaSlideDown 0.4s ease-out;
}

.swa-slideUp {
    animation: swaSlideUp 0.4s ease-out;
}

.swa-zoomIn {
    animation: swaZoomIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.swa-bounceIn {
    animation: swaBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Keyframe animations */
@keyframes swaFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes swaSlideDown {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes swaSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes swaZoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes swaBounceIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .swa-popup {
        width: 95vw !important;
        margin: 10px;
    }
    
    .swa-popup.swa-slide-in,
    .swa-popup.swa-corner {
        width: 90vw;
        left: 5vw !important;
        right: 5vw !important;
    }
    
    .swa-content {
        padding: 20px;
    }
    
    .swa-title {
        font-size: 1.3em;
    }
    
    .swa-close-btn {
        top: 10px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .swa-content {
        padding: 15px;
    }
    
    .swa-title {
        font-size: 1.2em;
        margin-bottom: 10px;
    }
    
    .swa-dismiss-btn {
        padding: 10px 25px;
        font-size: 13px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .swa-popup {
        background-color: var(--swa-popup-bg, #2d2d2d);
        color: var(--swa-popup-text, #ffffff);
    }
    
    .swa-close-btn {
        color: #ccc;
    }
    
    .swa-close-btn:hover {
        background-color: rgba(255,255,255,0.1);
        color: #fff;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .swa-popup {
        border: 2px solid currentColor;
    }
    
    .swa-dismiss-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .swa-popup,
    .swa-close-btn,
    .swa-dismiss-btn {
        transition: none;
    }
    
    .swa-fadeIn,
    .swa-slideDown,
    .swa-slideUp,
    .swa-zoomIn,
    .swa-bounceIn {
        animation: none;
    }
}