/* ── PureTextTools Cookie Consent Banner ── */

#cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #1a1a18;
    color: #f0ede8;
    padding: 1.25rem 1.5rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
    border-top: 1px solid rgba(255,255,255,0.08);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    animation: ccSlideUp 0.35s ease both;
}

#cc-banner.cc-visible {
    display: flex;
}

@keyframes ccSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.cc-text {
    flex: 1;
    min-width: 240px;
    color: rgba(240,237,232,0.85);
}

.cc-text strong {
    display: block;
    color: #f0ede8;
    font-weight: 500;
    margin-bottom: 3px;
    font-size: 0.9rem;
}

.cc-text a {
    color: #7da3f5;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-text a:hover { color: #a8c0ff; }

.cc-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cc-btn {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.55rem 1.25rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
    white-space: nowrap;
    line-height: 1;
}

.cc-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.cc-btn:active { transform: translateY(0); }

.cc-btn-accept {
    background: #2d5be3;
    color: #ffffff;
}

.cc-btn-decline {
    background: rgba(255,255,255,0.1);
    color: rgba(240,237,232,0.8);
    border: 1px solid rgba(255,255,255,0.15);
}

.cc-btn-decline:hover {
    background: rgba(255,255,255,0.15);
    opacity: 1;
}

/* ── Preference modal ── */
#cc-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

#cc-modal.cc-modal-visible {
    display: flex;
    animation: ccFadeIn 0.2s ease both;
}

@keyframes ccFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cc-modal-box {
    background: #ffffff;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: ccModalUp 0.25s ease both;
}

@keyframes ccModalUp {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.cc-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a18;
    margin-bottom: 0.5rem;
    font-family: 'Syne', 'DM Sans', sans-serif;
    letter-spacing: -0.02em;
}

.cc-modal-desc {
    font-size: 0.875rem;
    color: #6b6b62;
    margin-bottom: 1.5rem;
    line-height: 1.65;
    font-weight: 300;
}

.cc-toggle-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(26,26,24,0.1);
}

.cc-toggle-row:last-of-type {
    border-bottom: 1px solid rgba(26,26,24,0.1);
    margin-bottom: 1.5rem;
}

.cc-toggle-info strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1a1a18;
    margin-bottom: 2px;
}

.cc-toggle-info span {
    font-size: 0.8rem;
    color: #6b6b62;
    font-weight: 300;
    line-height: 1.5;
}

/* Toggle switch */
.cc-switch {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cc-switch-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #d1d1c7;
    transition: background 0.2s;
    cursor: pointer;
}

.cc-switch input:checked + .cc-switch-track {
    background: #2d5be3;
}

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

.cc-switch input:checked + .cc-switch-track::after {
    transform: translateX(18px);
}

.cc-switch input:disabled + .cc-switch-track {
    opacity: 0.5;
    cursor: not-allowed;
}

.cc-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.cc-modal-btn {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}

.cc-modal-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.cc-modal-btn-save {
    background: #2d5be3;
    color: #fff;
}

.cc-modal-btn-all {
    background: #f0efe9;
    color: #1a1a18;
    border: 1px solid rgba(26,26,24,0.15);
}

/* ── Re-open preferences link ── */
#cc-reopen {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 9998;
    background: #1a1a18;
    color: rgba(240,237,232,0.7);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    display: none;
    letter-spacing: 0.02em;
    transition: opacity 0.15s;
}

#cc-reopen:hover { opacity: 0.8; }
#cc-reopen.cc-reopen-visible { display: block; }

@media (max-width: 560px) {
    #cc-banner { padding: 1rem; gap: 1rem; }
    .cc-actions { width: 100%; justify-content: flex-end; }
    .cc-modal-box { padding: 1.5rem; }
    .cc-modal-actions { justify-content: stretch; }
    .cc-modal-btn { flex: 1; text-align: center; }
}
