/**
 * E-Commerce Notification Manager - Frontend Styles
 * Location: /assets/css/frontend.css
 */

/* Base Notification Styles */
.ecnm-notification {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    transform: translateY(0);
    opacity: 1;
}

.ecnm-notification * {
    box-sizing: border-box;
}

/* Position Variations */
.ecnm-notification.ecnm-position-top-bar {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}

.ecnm-notification.ecnm-position-bottom-bar {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
}

.ecnm-notification.ecnm-position-popup-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 600px;
    width: 90%;
    border-radius: 8px;
}

.ecnm-notification.ecnm-position-slide-right {
    top: 20px;
    right: 20px;
    max-width: 400px;
    width: calc(100% - 40px);
    border-radius: 8px;
}

.ecnm-notification.ecnm-position-slide-left {
    top: 20px;
    left: 20px;
    max-width: 400px;
    width: calc(100% - 40px);
    border-radius: 8px;
}

/* Animation Styles */
.ecnm-notification.ecnm-animation-fade {
    animation: ecnmFadeIn 0.3s ease;
}

.ecnm-notification.ecnm-animation-slide-down {
    animation: ecnmSlideDown 0.3s ease;
}

.ecnm-notification.ecnm-animation-slide-up {
    animation: ecnmSlideUp 0.3s ease;
}

.ecnm-notification.ecnm-animation-bounce {
    animation: ecnmBounce 0.5s ease;
}

/* Animation Keyframes */
@keyframes ecnmFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes ecnmSlideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes ecnmSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes ecnmBounce {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Notification Inner Container */
.ecnm-notification-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Close Button */
.ecnm-close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 5px;
    font-size: 24px;
    line-height: 1;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.ecnm-close:hover {
    opacity: 1;
}

.ecnm-position-popup-center .ecnm-close,
.ecnm-position-slide-right .ecnm-close,
.ecnm-position-slide-left .ecnm-close {
    top: 10px;
    transform: none;
}

/* Layout 1: Horizontal Bar */
.ecnm-layout-1 .ecnm-notification-inner {
    display: flex;
    align-items: center;
    padding: 15px 50px 15px 20px;
    gap: 20px;
}

.ecnm-layout-1 .ecnm-content {
    flex: 1;
}

.ecnm-layout-1 .ecnm-headline {
    margin: 0 0 4px 0;
    font-weight: 600;
}

.ecnm-layout-1 .ecnm-message {
    margin: 0;
    opacity: 0.9;
}

/* Layout 2: Centered */
.ecnm-layout-2 .ecnm-notification-inner {
    text-align: center;
    padding: 30px 50px;
}

.ecnm-layout-2 .ecnm-headline {
    margin: 0 0 10px 0;
    font-weight: 600;
}

.ecnm-layout-2 .ecnm-message {
    margin: 0 0 20px 0;
    opacity: 0.9;
}

/* Layout 3 & 4: With Image */
.ecnm-layout-3 .ecnm-notification-inner,
.ecnm-layout-4 .ecnm-notification-inner {
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.ecnm-layout-3 .ecnm-image,
.ecnm-layout-4 .ecnm-image {
    flex-shrink: 0;
    width: 150px;
}

.ecnm-layout-3 .ecnm-image img,
.ecnm-layout-4 .ecnm-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ecnm-layout-3 .ecnm-content,
.ecnm-layout-4 .ecnm-content {
    padding: 20px 50px 20px 20px;
    flex: 1;
}

.ecnm-layout-4 .ecnm-notification-inner {
    flex-direction: row-reverse;
}

/* Layout 5: Image Top */
.ecnm-layout-5 .ecnm-content {
    padding: 0;
}

.ecnm-layout-5 .ecnm-image-top {
    width: 100%;
    height: 150px;
    margin-bottom: 15px;
}

.ecnm-layout-5 .ecnm-image-top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ecnm-layout-5 .ecnm-headline,
.ecnm-layout-5 .ecnm-message,
.ecnm-layout-5 .ecnm-button {
    margin-left: 20px;
    margin-right: 50px;
}

.ecnm-layout-5 .ecnm-headline {
    margin-bottom: 8px;
    font-weight: 600;
}

.ecnm-layout-5 .ecnm-message {
    margin-bottom: 15px;
    opacity: 0.9;
}

/* Layout 6: Split Content */
.ecnm-layout-6 .ecnm-layout-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 50px 15px 20px;
    gap: 20px;
}

.ecnm-layout-6 .ecnm-content {
    flex: 1;
}

.ecnm-layout-6 .ecnm-headline {
    margin: 0 0 4px 0;
    font-weight: 600;
}

.ecnm-layout-6 .ecnm-message {
    margin: 0;
    opacity: 0.9;
}

/* Layout 7: Inline CTA */
.ecnm-layout-7 .ecnm-layout-inline {
    padding: 15px 50px 15px 20px;
}

.ecnm-layout-7 .ecnm-inline-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.ecnm-layout-7 .ecnm-headline {
    margin: 0;
    flex: 1;
    font-weight: 600;
}

.ecnm-layout-7 .ecnm-message {
    margin: 0;
    opacity: 0.9;
}

/* Layout 8: Overlay */
.ecnm-layout-8 .ecnm-layout-overlay {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    background-color: #333;
}

.ecnm-layout-8 .ecnm-overlay-content {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px 50px 20px 20px;
    width: 100%;
}

.ecnm-layout-8 .ecnm-headline {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: white;
}

.ecnm-layout-8 .ecnm-message {
    margin: 0 0 15px 0;
    opacity: 0.9;
    color: white;
}

.ecnm-layout-8 .ecnm-button {
    background: white;
    color: #333;
}

/* Layout 8: Image Only Mode */
.ecnm-layout-8 .ecnm-layout-overlay.ecnm-image-only {
    background: none;
    min-height: auto;
    display: block;
    padding: 0;
}

.ecnm-layout-8 .ecnm-layout-overlay.ecnm-image-only img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
}

/* Special handling for popup/slide positions with image-only overlay */
.ecnm-position-popup-center.ecnm-layout-8 .ecnm-layout-overlay.ecnm-image-only img,
.ecnm-position-slide-right.ecnm-layout-8 .ecnm-layout-overlay.ecnm-image-only img,
.ecnm-position-slide-left.ecnm-layout-8 .ecnm-layout-overlay.ecnm-image-only img {
    border-radius: 8px;
}

/* Text Size Variations */
.ecnm-headline.ecnm-size-s {
    font-size: 0.875rem;
}

.ecnm-headline.ecnm-size-m {
    font-size: 1rem;
}

.ecnm-headline.ecnm-size-l {
    font-size: 1.25rem;
}

.ecnm-headline.ecnm-size-xl {
    font-size: 1.5rem;
}

.ecnm-message.ecnm-size-s {
    font-size: 0.75rem;
}

.ecnm-message.ecnm-size-m {
    font-size: 0.875rem;
}

.ecnm-message.ecnm-size-l {
    font-size: 1rem;
}

.ecnm-message.ecnm-size-xl {
    font-size: 1.125rem;
}

/* Button Styles */
.ecnm-button {
    display: inline-block;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.ecnm-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ecnm-button.ecnm-size-s {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.ecnm-button.ecnm-size-m {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.ecnm-button.ecnm-size-l {
    padding: 10px 20px;
    font-size: 1rem;
}

.ecnm-button.ecnm-size-xl {
    padding: 12px 24px;
    font-size: 1.125rem;
}

/* Hidden State */
.ecnm-notification.ecnm-hidden {
    display: none;
}

.ecnm-notification.ecnm-hiding {
    opacity: 0;
    transform: translateY(-20px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ecnm-notification {
        font-size: 14px;
    }

    .ecnm-position-slide-right,
    .ecnm-position-slide-left {
        width: calc(100% - 20px);
        max-width: none;
        left: 10px;
        right: 10px;
    }

    .ecnm-layout-1 .ecnm-notification-inner {
        flex-direction: column;
        text-align: center;
        padding: 15px 40px;
    }

    .ecnm-layout-3 .ecnm-notification-inner,
    .ecnm-layout-4 .ecnm-notification-inner {
        flex-direction: column;
    }

    .ecnm-layout-3 .ecnm-image,
    .ecnm-layout-4 .ecnm-image {
        width: 100%;
        height: 150px;
    }

    .ecnm-headline.ecnm-size-xl {
        font-size: 1.25rem;
    }

    .ecnm-button {
        width: 100%;
        max-width: 200px;
    }
}

/* Accessibility */
.ecnm-notification:focus-within {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.ecnm-close:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .ecnm-notification {
        display: none !important;
    }
}