/* TCS Public Styles */

/* Floating Button Dropdown */
.tcs-floating-button-container {
    position: relative;
    display: inline-block;
}

.tcs-floating-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--tcs-banner-bg, #fff);
    border: 1px solid var(--tcs-banner-border, #ddd);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 100000;
    margin-bottom: 8px;
}

.tcs-floating-dropdown button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--tcs-banner-text, #111);
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.tcs-floating-dropdown button:hover {
    background: var(--tcs-banner-hover, #f5f5f5);
}

.tcs-floating-dropdown button:first-child {
    border-radius: 4px 4px 0 0;
}

.tcs-floating-dropdown button:last-child {
    border-radius: 0 0 4px 4px;
}

.tcs-floating-dropdown button:only-child {
    border-radius: 4px;
}

/* Show dropdown on hover */
.tcs-floating-button-container:hover .tcs-floating-dropdown {
    display: block !important;
}

.tcs-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99999;
    background: var(--tcs-banner-bg, #fff);
    color: var(--tcs-banner-text, #111);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
    padding: 16px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif
}

.tcs-banner.top {
    top: 0
}

.tcs-banner.bottom {
    bottom: 0
}

.tcs-banner .tcs-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    gap: 16px;
    align-items: center
}

/* Ensure the copy block can stack title+desc nicely */
.tcs-banner .tcs-copy {
    display: block;
}

.tcs-banner .tcs-copy strong {
    display: block;
}

.tcs-banner .tcs-actions {
    margin-inline-start: auto;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 8px;
    align-items: stretch
}

.tcs-banner .tcs-actions>div {
    display: flex;
    flex-direction: column;
    align-items: stretch
}

.tcs-banner .tcs-actions .tcs-btn,
.tcs-banner .tcs-actions .tcs-link {
    width: 100%;
    min-height: 46px
}

.tcs-btn {
    appearance: none;
    border: 1px solid var(--tcs-btn-primary-bg, #111);
    background: var(--tcs-btn-primary-bg, #111);
    color: var(--tcs-btn-primary-text, #fff);
    border-radius: 4px;
    padding: 10px 14px;
    cursor: pointer
}

.tcs-btn.secondary {
    background: var(--tcs-btn-secondary-bg, #fff);
    color: var(--tcs-btn-secondary-text, #111);
    border-color: var(--tcs-btn-secondary-bg, #fff)
}

.tcs-link {
    appearance: none;
    border: 1px solid var(--tcs-btn-secondary-bg, #eee);
    background: var(--tcs-btn-secondary-bg, #fff);
    color: var(--tcs-btn-secondary-text, #111);
    border-radius: 4px;
    padding: 10px 14px;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    text-decoration: underline;
    text-underline-offset: 3px
}

.tcs-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .55);
    z-index: 100000
}

.tcs-modal.active {
    display: flex
}

.tcs-modal .tcs-dialog {
    background: var(--tcs-modal-bg, #fff);
    color: var(--tcs-modal-text, #111);
    border-radius: 8px;
    max-width: 720px;
    width: 94%;
    max-height: 80vh;
    overflow: auto;
    padding: 20px
}

.tcs-floating-button {
    position: fixed;
    bottom: 20px;
    inset-inline-end: 20px;
    z-index: 99998;
    border: 1px solid var(--tcs-accent, #111);
    background: #fff;
    color: var(--tcs-accent, #111);
    border-radius: 999px;
    padding: 10px 14px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .15)
}

.tcs-help {
    display: block;
    font-size: 12px;
    opacity: .8;
    margin-top: 4px
}

.tcs-help-tip {
    display: inline-block;
    margin-inline-start: 8px;
    border-radius: 999px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: var(--tcs-accent, #0a5);
    color: #fff;
    font-size: 12px
}

.tcs-rtl .tcs-container {
    flex-direction: row-reverse;
    text-align: right
}

/* Ensure copy panel sits on the right in RTL and actions on left */
.tcs-rtl .tcs-container {
    justify-content: space-between;
}

.tcs-rtl .tcs-container> :first-child {
    order: 2;
}

.tcs-rtl .tcs-container> :last-child {
    order: 1;
}

.tcs-rtl .tcs-banner,
.tcs-rtl .tcs-modal .tcs-dialog {
    direction: rtl
}

/* Responsive – Mobile layout without affecting desktop */
@media (max-width: 768px) {
    .tcs-banner .tcs-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-inline: 12px;
    }

    /* Reset RTL ordering on mobile so copy is first */
    .tcs-rtl .tcs-container> :first-child {
        order: 1;
    }

    .tcs-rtl .tcs-container> :last-child {
        order: 2;
    }

    .tcs-banner .tcs-actions {
        margin-inline-start: 0;
        grid-auto-flow: row;
        grid-auto-columns: unset;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .tcs-banner .tcs-actions>div {
        width: 100%;
    }

    .tcs-banner .tcs-actions .tcs-btn,
    .tcs-banner .tcs-actions .tcs-link {
        min-height: 44px;
        font-size: 14px;
    }

    .tcs-help {
        font-size: 11px;
    }


    /* Credit line */
    .tcs-credit {
        position: fixed;
        left: 10%;
        bottom: -1%;
        transform: translateY(-50%) rotate(-90deg);
        transform-origin: left top;
        z-index: 999999999;
        opacity: .78;
        font: 500 11px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
        color: var(--tcs-banner-text, #ffffff);
        pointer-events: auto;
    }

    .tcs-credit a {
        color: var(--tcs-banner-text, #e8f0ff);
        text-decoration: underline;
    }

    .tcs-rtl .tcs-credit {
        left: 2px;
        right: auto;
    }
}

/* Credit line */
.tcs-credit {
    position: fixed;
    left: 10%;
    bottom: -1%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left top;
    z-index: 999999999;
    opacity: .78;
    font: 500 11px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--tcs-banner-text, #ffffff);
    pointer-events: auto;
}

.tcs-credit a {
    color: var(--tcs-banner-text, #e8f0ff);
    text-decoration: underline;
}

.tcs-rtl .tcs-credit {
    left: 2px;
    right: auto;
}