/* ThaiTodays Events, Holidays & Notice Hub Styles v3.5.0 */

/* ================= 1. Top and Bottom Notification Bars (Smooth Transitions) ================= */
.tt-bar-notice {
    width: 100%;
    z-index: 999998;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Sarabun", sans-serif;
    font-size: 14px;
    line-height: 1.45;
    box-sizing: border-box;
    /* Smooth Transition properties */
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tt-bar-top {
    position: relative;
    top: 0;
    left: 0;
    transform: translateY(-100%);
}

.tt-bar-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    transform: translateY(100%);
}

/* State when active / visible */
.tt-bar-notice.tt-bar-visible {
    opacity: 1;
    max-height: 160px;
    transform: translateY(0);
}

/* State when fading out / closing smoothly */
.tt-bar-notice.tt-bar-hiding {
    opacity: 0 !important;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    pointer-events: none !important;
}

.tt-bar-top.tt-bar-hiding {
    transform: translateY(-100%) !important;
}

.tt-bar-bottom.tt-bar-hiding {
    transform: translateY(100%) !important;
}

.tt-bar-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-sizing: border-box;
}

.tt-bar-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.tt-tag-ad {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.tt-tag-breaking {
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    animation: tt-pulse 2s infinite;
}

@keyframes tt-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.tt-bar-title {
    font-weight: 700;
}

.tt-bar-desc {
    opacity: 0.95;
}

.tt-bar-link {
    text-decoration: underline;
    font-weight: 700;
    margin-left: 5px;
    transition: opacity 0.2s ease;
}

.tt-bar-link:hover {
    opacity: 0.8;
}

.tt-bar-close-btn {
    background: transparent !important;
    border: none !important;
    font-size: 26px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 4px 10px !important;
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.2s ease;
    border-radius: 4px !important;
}

.tt-bar-close-btn:hover {
    opacity: 1;
    transform: scale(1.15);
    background: rgba(0, 0, 0, 0.1) !important;
}

/* ================= 2. Modal Pop-up (Centered, Responsive, Full Banner View) ================= */
.tt-enh-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.78) !important;
    backdrop-filter: blur(5px) !important;
    z-index: 99999999 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tt-enh-backdrop.tt-enh-show {
    opacity: 1 !important;
    visibility: visible !important;
}

.tt-enh-modal {
    position: relative !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    max-width: 540px !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4) !important;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Sarabun", sans-serif !important;
    box-sizing: border-box !important;
}

.tt-enh-backdrop.tt-enh-show .tt-enh-modal {
    transform: scale(1) translateY(0);
}

/* State when closing modal smoothly */
.tt-enh-backdrop.tt-enh-hiding {
    opacity: 0 !important;
    visibility: hidden !important;
}

.tt-enh-backdrop.tt-enh-hiding .tt-enh-modal {
    transform: scale(0.95) translateY(15px) !important;
}

/* Strict Perfect Circle Close Button */
button.tt-enh-close-circle,
.tt-enh-close-circle {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background: rgba(15, 23, 42, 0.75) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.85) !important;
    font-size: 22px !important;
    line-height: 30px !important;
    font-family: Arial, sans-serif !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 99 !important;
    box-sizing: border-box !important;
    aspect-ratio: 1 / 1 !important;
    transition: background 0.2s ease, transform 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

button.tt-enh-close-circle:hover,
.tt-enh-close-circle:hover {
    background: rgba(0, 0, 0, 0.95) !important;
    transform: scale(1.1) !important;
}

.tt-modal-ad-badge {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    background: rgba(15, 23, 42, 0.7) !important;
    color: #ffffff !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    z-index: 10 !important;
}

/* Image Full View (No Cropping) */
.tt-enh-img-wrap {
    width: 100% !important;
    max-height: 65vh !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #0f172a !important;
}

.tt-enh-banner {
    width: 100% !important;
    height: auto !important;
    max-height: 65vh !important;
    display: block !important;
    object-fit: contain !important;
    margin: 0 auto !important;
}

.tt-enh-modal-body {
    padding: 20px 24px 24px 24px !important;
    text-align: center !important;
}

.tt-enh-title {
    margin: 0 0 10px 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    line-height: 1.35 !important;
}

.tt-enh-desc {
    font-size: 14px !important;
    color: #475569 !important;
    line-height: 1.6 !important;
    margin-bottom: 18px !important;
}

.tt-enh-btn-row {
    margin-top: 15px !important;
}

.tt-enh-btn-cta {
    display: inline-block !important;
    background: #0284c7 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    border-radius: 25px !important;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35) !important;
    transition: background 0.2s ease, transform 0.2s ease !important;
}

.tt-enh-btn-cta:hover {
    background: #0369a1 !important;
    transform: translateY(-2px) !important;
    color: #ffffff !important;
}

/* ================= 3. Festival Cards & Widgets ================= */
.tt-fest-widget-stream {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 15px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Sarabun", sans-serif;
}

.tt-fest-card-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tt-fest-card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.tt-fest-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}

.tt-fest-thumb-wrap {
    position: relative;
    width: 100%;
    max-height: 180px;
    overflow: hidden;
    background: #f1f5f9;
}

.tt-fest-thumb-wrap img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.tt-fest-badge-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #0284c7;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.tt-fest-type-advertising .tt-fest-badge-tag {
    background: #f59e0b;
}

.tt-fest-card-body {
    padding: 14px 16px;
}

.tt-fest-card-title {
    margin: 0 0 6px 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.tt-fest-highlight {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
}

.tt-fest-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 12px;
}

.tt-fest-date-chip, .tt-fest-loc-chip {
    background: #f1f5f9;
    color: #334155;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.tt-fest-action-btn {
    font-size: 13px;
    font-weight: 700;
    color: #0284c7;
    text-align: right;
}

@media (max-width: 640px) {
    .tt-bar-container {
        padding: 8px 12px;
        font-size: 13px;
    }
    .tt-bar-content {
        gap: 6px;
    }
    .tt-bar-desc {
        display: none;
    }
    .tt-enh-modal {
        max-width: 95% !important;
    }
    .tt-enh-title {
        font-size: 17px !important;
    }
    .tt-enh-modal-body {
        padding: 16px !important;
    }
}

/* Status chips in Widget Card */
.tt-fest-status-chip {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}
.tt-chip-teaser {
    background: #e0f2fe;
    color: #0369a1;
}
.tt-chip-live {
    background: #dcfce7;
    color: #15803d;
}

/* Format Badge (Online / Onsite / Hybrid) */
.tt-fest-format-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.tt-gcal-btn:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    transform: translateY(-1px);
}

/* Today in History Widget Cards (v4.2.0) */
.tt-history-widget-stream {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 15px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Sarabun", sans-serif;
}
.tt-history-card-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tt-history-card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}
.tt-history-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}
.tt-history-thumb-wrap {
    position: relative;
    width: 100%;
    max-height: 140px;
    overflow: hidden;
    background: #f1f5f9;
}
.tt-history-thumb-wrap img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}
.tt-history-date-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(15, 23, 42, 0.85);
    color: #f8fafc;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}
.tt-history-card-body {
    padding: 12px 14px;
}
.tt-history-card-title {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}
.tt-history-snippet {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}
.tt-history-readmore {
    font-size: 12px;
    font-weight: 700;
    color: #0284c7;
    display: inline-block;
}