/* =============================================
   TASSEL Consent v1.0.0 - consent.css
   ASCII only - dhosting compatible
   ============================================= */

/* ---- Root variables (overridden inline by PHP) ---- */
:root {
    --tc-bg:          #ffffff;
    --tc-text:        #1a1a1a;
    --tc-accent:      #2563eb;
    --tc-btn-text:    #ffffff;
    --tc-reject-bg:   #f3f4f6;
    --tc-reject-text: #374151;
    --tc-radius:      12px;
}

/* ---- Overlay ---- */
.tc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.tc-overlay.tc-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ---- Popup base ---- */
#tc-popup {
    position: fixed;
    z-index: 99999;
    left: 0;
    right: 0;
    background: var(--tc-bg);
    color: var(--tc-text);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;

    /* Hidden by default */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

#tc-popup * { box-sizing: border-box; }

#tc-popup.tc-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ---- Position: bottom (default) ---- */
.tc-position-bottom {
    bottom: 0;
    transform: translateY(24px);
    box-shadow: 0 -2px 20px rgba(0,0,0,0.10);
}

.tc-position-bottom.tc-visible {
    transform: translateY(0);
}

/* ---- Position: top ---- */
.tc-position-top {
    top: 0;
    transform: translateY(-24px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.10);
}

.tc-position-top.tc-visible {
    transform: translateY(0);
}

/* ---- Position: modal ---- */
.tc-position-modal {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(560px, calc(100vw - 32px));
    transform: translate(-50%, -50%) scale(0.96);
    border-radius: var(--tc-radius);
    box-shadow: 0 8px 48px rgba(0,0,0,0.18);
}

.tc-position-modal.tc-visible {
    transform: translate(-50%, -50%) scale(1);
}

/* ---- Inner layout ---- */
.tc-popup__inner {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 18px 24px;
    max-width: 1280px;
    margin: 0 auto;
}

.tc-position-modal .tc-popup__inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 28px 24px;
}

/* ---- Content ---- */
.tc-popup__content {
    flex: 1;
    min-width: 200px;
}

.tc-popup__title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: inherit;
}

.tc-popup__text {
    font-size: 0.84rem;
    margin: 0;
    opacity: 0.75;
    line-height: 1.5;
}

/* ---- Action buttons container ---- */
.tc-popup__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.tc-position-modal .tc-popup__actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
}

.tc-position-modal .tc-popup__actions .tc-btn {
    width: 100%;
    justify-content: center;
}

/* ---- Buttons ---- */
.tc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: var(--tc-radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.tc-btn:hover  { opacity: 0.88; }
.tc-btn:active { transform: scale(0.97); }

.tc-btn:focus-visible {
    outline: 3px solid var(--tc-accent);
    outline-offset: 2px;
}

/* Primary = accent color, equal visual weight as secondary (GDPR requirement) */
.tc-btn--primary {
    background: var(--tc-accent);
    color: var(--tc-btn-text);
    border-color: var(--tc-accent);
}

/* Secondary = visually equal to primary per TSUE ruling */
.tc-btn--secondary {
    background: var(--tc-reject-bg);
    color: var(--tc-reject-text);
    border-color: var(--tc-reject-bg);
}

/* Ghost = settings link - lighter, same line height */
.tc-btn--ghost {
    background: transparent;
    color: var(--tc-text);
    opacity: 0.6;
    padding: 10px 14px;
    border-color: transparent;
}

.tc-btn--ghost:hover { opacity: 1; }

/* ---- Settings panel ---- */
#tc-settings-panel {
    position: fixed;
    z-index: 99999;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(32px);
    width: min(520px, 100vw);
    max-height: 88vh;
    background: var(--tc-bg);
    color: var(--tc-text);
    border-radius: var(--tc-radius) var(--tc-radius) 0 0;
    box-shadow: 0 -4px 40px rgba(0,0,0,0.16);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

#tc-settings-panel * { box-sizing: border-box; }

#tc-settings-panel.tc-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.tc-settings-panel__inner {
    display: flex;
    flex-direction: column;
    max-height: 88vh;
    overflow: hidden;
}

.tc-settings-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.tc-settings-panel__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: inherit;
}

.tc-settings-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--tc-text);
    opacity: 0.5;
    border-radius: 6px;
    transition: opacity 0.15s;
    font-family: inherit;
    line-height: 1;
}

.tc-settings-panel__close:hover { opacity: 1; }
.tc-settings-panel__close:focus-visible {
    outline: 3px solid var(--tc-accent);
    outline-offset: 2px;
}

.tc-settings-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 24px;
    -webkit-overflow-scrolling: touch;
}

.tc-settings-panel__footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.tc-settings-panel__footer .tc-btn {
    flex: 1;
    justify-content: center;
}

/* ---- Category toggle rows ---- */
.tc-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.tc-toggle-row:last-child { border-bottom: none; }

.tc-toggle-row__info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.tc-toggle-row__info strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tc-text);
}

.tc-toggle-row__info span {
    font-size: 0.8rem;
    opacity: 0.6;
    line-height: 1.4;
}

/* Badge "Zawsze aktywne" */
.tc-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--tc-accent);
    background: rgba(37, 99, 235, 0.1);
    padding: 4px 10px;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.01em;
}

/* ---- Toggle switch ---- */
.tc-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
}

.tc-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.tc-switch__track {
    display: block;
    width: 46px;
    height: 26px;
    background: #d1d5db;
    border-radius: 999px;
    transition: background 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.tc-switch__track::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.tc-switch input:checked + .tc-switch__track {
    background: var(--tc-accent);
}

.tc-switch input:checked + .tc-switch__track::after {
    transform: translateX(20px);
}

.tc-switch input:focus-visible + .tc-switch__track {
    outline: 3px solid var(--tc-accent);
    outline-offset: 2px;
}

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

/* ---- Mobile ---- */
@media (max-width: 640px) {
    .tc-popup__inner {
        flex-direction: column;
        padding: 16px 16px 14px;
        gap: 14px;
    }

    .tc-popup__actions {
        width: 100%;
        flex-direction: column;
    }

    .tc-popup__actions .tc-btn {
        width: 100%;
        justify-content: center;
    }

    #tc-settings-panel {
        width: 100%;
        border-radius: var(--tc-radius) var(--tc-radius) 0 0;
    }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    #tc-popup,
    #tc-settings-panel,
    .tc-overlay {
        transition: opacity 0.15s ease !important;
    }
}

/* =============================================
   v1.2.0 - Style: card / bar / modal
   Nowy domyslny popup w stylu CookieYes (karta)
   ============================================= */

/* ---- Card style: floating panel in corner (CookieYes-like) ---- */
.tc-popup--card {
    left: auto;
    right: auto;
    top: auto;
    bottom: 24px;
    width: 420px;
    max-width: calc(100vw - 32px);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.04);
}

.tc-popup--card.tc-popup--corner-left   { left: 24px; }
.tc-popup--card.tc-popup--corner-right  { right: 24px; }
.tc-popup--card.tc-popup--corner-center {
    left: 50%;
    transform: translateX(-50%) translateY(24px);
}
.tc-popup--card.tc-popup--corner-center.tc-visible {
    transform: translateX(-50%) translateY(0);
}

.tc-popup--card .tc-popup__inner {
    flex-direction: column;
    align-items: stretch;
    padding: 22px 22px 16px;
    max-width: none;
    margin: 0;
    gap: 14px;
}

.tc-popup--card .tc-popup__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.tc-popup--card .tc-popup__text {
    font-size: 0.85rem;
    line-height: 1.55;
    opacity: 0.78;
}

.tc-popup--card .tc-popup__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 4px;
}

.tc-popup--card .tc-popup__actions .tc-btn {
    flex: 1;
    padding: 10px 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    min-width: 0;
}

.tc-popup--card .tc-popup__actions .tc-btn--ghost {
    flex: 0 0 auto;
    padding: 10px 12px;
}

@media (max-width: 540px) {
    .tc-popup--card {
        left: 12px !important;
        right: 12px !important;
        bottom: 12px;
        width: auto;
        max-width: none;
    }
    .tc-popup--card.tc-popup--corner-center {
        transform: translateY(12px);
    }
    .tc-popup--card.tc-popup--corner-center.tc-visible {
        transform: translateY(0);
    }
    .tc-popup--card .tc-popup__actions {
        flex-direction: column;
    }
    .tc-popup--card .tc-popup__actions .tc-btn {
        width: 100%;
        padding: 11px 14px;
        font-size: 0.86rem;
    }
}

/* ---- Bar style: pelnoszerokosci pasek (backward-compat) ---- */
.tc-popup--bar {
    left: 0;
    right: 0;
    width: auto;
    border-radius: 0;
}
.tc-popup--bar.tc-popup--corner-left,
.tc-popup--bar.tc-popup--corner-center {
    bottom: 0;
    top: auto;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.10);
}
.tc-popup--bar.tc-popup--corner-right {
    top: 0;
    bottom: auto;
    box-shadow: 0 2px 20px rgba(0,0,0,0.10);
}
.tc-popup--bar .tc-popup__inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 18px 24px;
    max-width: 1280px;
    margin: 0 auto;
    gap: 20px;
}

/* ---- Modal style: srodek z backdrop ---- */
.tc-popup--modal {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(520px, calc(100vw - 32px));
    transform: translate(-50%, -50%) scale(0.96);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.tc-popup--modal.tc-visible {
    transform: translate(-50%, -50%) scale(1);
}
.tc-popup--modal .tc-popup__inner {
    flex-direction: column;
    align-items: stretch;
    padding: 28px 28px 22px;
    max-width: none;
    gap: 16px;
}
.tc-popup--modal .tc-popup__actions {
    flex-direction: row;
    gap: 8px;
}
.tc-popup--modal .tc-popup__actions .tc-btn {
    flex: 1;
    justify-content: center;
}
@media (max-width: 480px) {
    .tc-popup--modal .tc-popup__actions {
        flex-direction: column;
    }
    .tc-popup--modal .tc-popup__actions .tc-btn {
        width: 100%;
    }
}

/* ---- Powered by footer ---- */
.tc-popup__footer {
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.07);
    font-size: 11px;
    line-height: 1;
    color: rgba(0,0,0,0.42);
    text-align: center;
}
.tc-popup__footer a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.tc-popup__footer a:hover {
    color: var(--tc-accent);
    text-decoration: underline;
}

/* ---- Bar style uses inline footer to the right ---- */
.tc-popup--bar .tc-popup__footer {
    border-top: 0;
    padding-top: 0;
    margin-left: auto;
}

/* ---- Ghost button (Dostosuj) - more visible than v1.1 ---- */
.tc-popup--card .tc-btn--ghost,
.tc-popup--modal .tc-btn--ghost {
    background: transparent;
    color: var(--tc-text);
    border: 2px solid rgba(0,0,0,0.10);
    opacity: 0.85;
}
.tc-popup--card .tc-btn--ghost:hover,
.tc-popup--modal .tc-btn--ghost:hover {
    border-color: rgba(0,0,0,0.18);
    opacity: 1;
}
