/*!
 * PC LAB Popup Campaigns - Frontend Styles
 * Copyright (C) 2026 PC LAB
 * License: GPL-2.0-or-later
 * Trademark notice: PC LAB branding and identifiers remain proprietary to PC LAB.
 */

.pclab-toast-notification {
    position: fixed;
    z-index: 99999;
    width: min(360px, calc(100vw - 32px));
    background: var(--pclab-bg, #14191f);
    color: var(--pclab-text, #ffffff);
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
    padding: 18px 18px 16px;
    font-family: inherit;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .28s ease, transform .28s ease;
}
.pclab-toast-notification.is-visible { opacity: 1; transform: translateY(0); }
.pclab-toast-bottom-right { right: 16px; bottom: 16px; }
.pclab-toast-bottom-left { left: 16px; bottom: 16px; }
.pclab-toast-layout-banner {
    width: min(760px, calc(100vw - 32px));
    padding: 18px 22px;
    border-radius: 20px;
    display: grid;
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}
.pclab-toast-layout-banner .pclab-toast-image-wrap {
    display: block;
    margin: 0;
}
.pclab-toast-layout-banner .pclab-toast-title {
    font-size: calc(var(--pclab-title-size, 16px) + 2px);
    margin-right: 48px;
}
.pclab-toast-layout-banner .pclab-toast-message {
    max-width: none;
}
.pclab-toast-layout-banner .pclab-toast-footer {
    align-items: center;
}
.pclab-toast-layout-banner .pclab-toast-image {
    min-height: 140px;
    border-radius: 16px;
}
.pclab-toast-layout-banner .pclab-toast-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.pclab-toast-layout-split {
    width: min(560px, calc(100vw - 32px));
    padding: 16px;
    border-radius: 22px;
    display: grid;
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}
.pclab-toast-layout-split .pclab-toast-close {
    top: 10px;
    right: 10px;
}
.pclab-toast-layout-split .pclab-toast-image-wrap {
    margin: 0;
    height: 100%;
}
.pclab-toast-layout-split .pclab-toast-image {
    height: 100%;
    min-height: 100%;
    border-radius: 16px;
}
.pclab-toast-layout-split .pclab-toast-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.pclab-toast-layout-card .pclab-toast-body,
.pclab-toast-layout-banner .pclab-toast-body {
    display: block;
    min-width: 0;
}
.pclab-toast-layout-split .pclab-toast-title {
    margin-top: 2px;
}
.pclab-toast-layout-split .pclab-toast-footer {
    margin-top: 8px;
}
.pclab-toast-title { font-size: var(--pclab-title-size, 16px); font-weight: 700; margin: 0 28px 8px 0; }
.pclab-toast-message { font-size: var(--pclab-message-size, 14px); margin: 0 0 14px; }
.pclab-toast-button { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 10px; background: var(--pclab-btn-bg, #ffffff); color: var(--pclab-btn-text, #14191f); text-decoration: none; font-size: var(--pclab-button-size, 14px); font-weight: 600; }
.pclab-toast-button:hover,.pclab-toast-button:focus { opacity: 0.92; color: var(--pclab-btn-text, #14191f); text-decoration: none; }
.pclab-toast-close { appearance: none; position: absolute; right: 10px; top: 8px; border: 0; background: transparent; color: var(--pclab-text, #ffffff); font-size: 24px; line-height: 1; padding: 4px; cursor: pointer; opacity: 0.8; }
.pclab-toast-close:hover,.pclab-toast-close:focus { opacity: 1; }
@media (max-width: 480px) {
    .pclab-toast-bottom-right,.pclab-toast-bottom-left { left: 12px; right: 12px; bottom: 12px; width: auto; }
    .pclab-toast-layout-banner,
    .pclab-toast-layout-split {
        width: auto;
    }
    .pclab-toast-layout-banner,
    .pclab-toast-layout-split {
        grid-template-columns: 1fr;
    }
}

.pclab-toast-image-wrap { margin: 0 0 12px; }
.pclab-toast-image { display: block; width: 100%; aspect-ratio: 1 / 1; height: auto; max-height: none; object-fit: cover; border-radius: 12px; }

.pclab-toast-title { display:flex; align-items:center; gap:10px; }
.pclab-toast-title-text { display:inline-block; }
.pclab-toast-when { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 14px; padding:10px 12px; border-radius:10px; background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.12); }
.pclab-toast-when-label { font-weight:700; }
.pclab-toast-when-date { opacity:0.95; text-align:right; }

.pclab-toast-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
}
.pclab-toast-upcoming {
    margin-left: auto;
    text-align: right;
    min-width: 0;
}
.pclab-toast-upcoming-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 6px;
}
.pclab-toast-upcoming-list {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}
.pclab-toast-upcoming-box {
    min-width: 44px;
    padding: 6px 6px 5px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.05;
}
.pclab-toast-upcoming-day {
    font-size: 12px;
    font-weight: 700;
}
.pclab-toast-upcoming-month {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 3px;
}
@media (max-width: 480px) {
    .pclab-toast-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .pclab-toast-upcoming {
        margin-left: 0;
        text-align: left;
    }
    .pclab-toast-upcoming-list {
        justify-content: flex-start;
    }
}


.pclab-toast-upcoming-item {
    position: relative;
    display: inline-flex;
}
.pclab-toast-upcoming-preview {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: 220px;
    max-width: min(220px, 70vw);
    padding: 10px 12px;
    border-radius: 12px;
    background: #ffffff;
    color: #14191f;
    box-shadow: 0 12px 28px rgba(0,0,0,0.22);
    border: 1px solid rgba(20,25,31,0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    pointer-events: none;
    text-align: left;
    z-index: 8;
}
.pclab-toast-upcoming-preview::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 100%;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-right: 1px solid rgba(20,25,31,0.08);
    border-bottom: 1px solid rgba(20,25,31,0.08);
    transform: rotate(45deg);
}
.pclab-toast-upcoming-item:hover .pclab-toast-upcoming-preview,
.pclab-toast-upcoming-item:focus-within .pclab-toast-upcoming-preview {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.pclab-toast-upcoming-preview-title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
}
.pclab-toast-upcoming-preview-date {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.8;
    margin-bottom: 4px;
}
.pclab-toast-upcoming-preview-message {
    font-size: 11px;
    line-height: 1.4;
    opacity: 0.9;
}
@media (max-width: 480px) {
    .pclab-toast-upcoming-preview {
        left: 0;
        right: auto;
        width: min(220px, calc(100vw - 64px));
    }
    .pclab-toast-upcoming-preview::after {
        left: 14px;
        right: auto;
    }
}


/* More visible close button */
.pclab-toast-close {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    transition: background .18s ease, transform .18s ease, border-color .18s ease, opacity .18s ease;
    opacity: 0.95;
}
.pclab-toast-close:hover,
.pclab-toast-close:focus {
    background: rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.42);
    transform: scale(1.06);
    opacity: 1;
}
.pclab-toast-close:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.18), 0 8px 18px rgba(0, 0, 0, 0.18);
}


/* Notification image ratio options */
.pclab-toast-image {
    position: relative;
    overflow: hidden;
}
.pclab-toast-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pclab-toast-image-ratio-1-1 {
    aspect-ratio: 1 / 1;
}
.pclab-toast-image-ratio-3-4 {
    aspect-ratio: 3 / 4;
}
.pclab-toast-image-ratio-4-3 {
    aspect-ratio: 4 / 3;
}
.pclab-toast-image-ratio-16-9 {
    aspect-ratio: 16 / 9;
}


/* Ensure close button stays above the image and remains clickable */
.pclab-toast-notification {
    position: fixed;
}
.pclab-toast-image {
    position: relative;
    z-index: 1;
}
.pclab-toast-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 30;
    pointer-events: auto;
}
