/* ==========================================================================
   Advertisement Popup Ads - Modal styles
   Theme-matched: #fe8400 accent, dark #010718 surfaces.
   ========================================================================== */

.tcc-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(1, 7, 24, 0.78);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.tcc-popup-overlay.is-open {
    display: flex;
    opacity: 1;
}

.tcc-popup-overlay.is-leaving {
    opacity: 0;
}

.tcc-popup {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 3rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(1, 7, 24, 0.45);
    transform: translateY(18px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tcc-popup-overlay.is-open .tcc-popup {
    transform: translateY(0) scale(1);
}

.tcc-popup--wide {
    max-width: 760px;
}

/* ---- Close button ---- */
.tcc-popup__close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    z-index: 3;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(1, 7, 24, 0.55);
    color: #ffffff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.tcc-popup__close:hover {
    background: #fe8400;
    transform: scale(1.08);
}

.tcc-popup__close:focus-visible {
    outline: 3px solid #fe8400;
    outline-offset: 2px;
}

/* ---- Header ---- */
.tcc-popup__header {
    padding: 1.25rem 3.2rem 1rem 1.5rem;
    border-bottom: 2px solid rgba(254, 132, 0, 0.18);
    background: linear-gradient(135deg, #010718 0%, #0a0f1f 100%);
    color: #ffffff;
}

.tcc-popup__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fe8400;
    line-height: 1.35;
}

/* ---- Body ---- */
.tcc-popup__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    color: #111827;
    font-size: 0.95rem;
    line-height: 1.65;
}

.tcc-popup__image {
    display: block;
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    border-radius: 8px;
}

.tcc-popup__html {
    margin-top: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Rich text defaults inside the popup body */
.tcc-popup__html h1,
.tcc-popup__html h2,
.tcc-popup__html h3 {
    color: #010718;
    margin: 0 0 0.6rem;
    line-height: 1.3;
}

.tcc-popup__html h1 { font-size: 1.45rem; }
.tcc-popup__html h2 { font-size: 1.25rem; }
.tcc-popup__html h3 { font-size: 1.1rem; }

.tcc-popup__html p {
    margin: 0 0 0.85rem;
}

.tcc-popup__html p:last-child {
    margin-bottom: 0;
}

.tcc-popup__html ul,
.tcc-popup__html ol {
    margin: 0 0 0.85rem;
    padding-left: 1.4rem;
}

.tcc-popup__html li {
    margin-bottom: 0.35rem;
}

.tcc-popup__html img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.tcc-popup__html a {
    color: #fe8400;
    font-weight: 700;
    text-decoration: underline;
}

.tcc-popup__html a:hover {
    color: #ff7600;
}

/* ---- Footer / actions ---- */
.tcc-popup__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.5rem;
    border-top: 2px solid rgba(254, 132, 0, 0.18);
    background: #f9fafb;
}

.tcc-popup__timer {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #6b7280;
}

.tcc-popup__timer i {
    color: #fe8400;
    font-size: 1rem;
}

.tcc-popup__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #fe8400 0%, #ff7600 100%);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tcc-popup__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(254, 132, 0, 0.35);
}

.tcc-popup__dismiss {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.2rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.tcc-popup__dismiss:hover {
    border-color: #fe8400;
    color: #fe8400;
}

.tcc-popup__cta:focus-visible,
.tcc-popup__dismiss:focus-visible {
    outline: 3px solid #fe8400;
    outline-offset: 2px;
}

/* ---- Screen-reader only / live region ---- */
.tcc-popup-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .tcc-popup-overlay {
        padding: 0.75rem;
        align-items: flex-end;
    }

    .tcc-popup {
        max-width: 100%;
        max-height: calc(100vh - 2rem);
        border-radius: 12px;
    }

    .tcc-popup__header {
        padding: 1.1rem 3rem 0.9rem 1.1rem;
    }

    .tcc-popup__body {
        padding: 1rem 1.1rem;
    }

    .tcc-popup__footer {
        padding: 0.9rem 1.1rem;
    }

    .tcc-popup__cta,
    .tcc-popup__dismiss {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .tcc-popup-overlay,
    .tcc-popup,
    .tcc-popup__cta,
    .tcc-popup__close {
        transition: none;
    }

    .tcc-popup-overlay.is-open .tcc-popup {
        transform: none;
    }
}
