/* Cookie Consent (Law 25) - uses the design tokens from style.css */
.cookie-consent {
    position: fixed;
    left: 1.5rem;
    bottom: 1.5rem;
    z-index: 10000;
    width: calc(100% - 3rem);
    max-width: 520px;
    background-color: rgba(13, 13, 17, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px var(--accent-glow);
    animation: ccIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-consent[hidden],
.cookie-consent [hidden] {
    display: none !important;
}

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

.cc-inner {
    padding: 1.75rem;
}

.cc-close {
    position: absolute;
    top: 1.1rem;
    right: 1.25rem;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition-smooth);
    -webkit-appearance: none;
    appearance: none;
    opacity: 0.65;
    z-index: 2;
}

.cc-close:hover {
    opacity: 1;
    color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.08);
}

.cc-close:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    opacity: 1;
}

.cc-title {
    font-size: 1.25rem;
    margin-bottom: 0.6rem;
    letter-spacing: -0.01em;
    padding-right: 2rem;
}

.cc-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.cc-link {
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}

.cc-link:hover {
    color: var(--accent-hover);
}

.cc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* Accept and Refuse share the exact same style so neither is nudged (Law 25) */
.cc-btn {
    flex: 1 1 auto;
    padding: 0.7rem 1.4rem;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid var(--accent-color);
}

.cc-btn-primary {
    background-color: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.cc-btn-primary:hover {
    transform: translateY(-2px);
    background-color: transparent;
    color: var(--accent-color);
    box-shadow: 0 6px 25px var(--accent-glow-strong);
}

.cc-btn-ghost {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.cc-btn-ghost:hover {
    border-color: var(--border-hover);
    color: var(--accent-color);
}

.cc-btn:focus-visible,
.cc-switch input:focus-visible + i {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

/* Preferences */
.cc-prefs {
    margin-bottom: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.cc-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border-color);
}

.cc-option strong {
    display: block;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.95rem;
}

.cc-option span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.cc-switch {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
    cursor: pointer;
}

.cc-switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

.cc-switch i {
    position: absolute;
    inset: 0;
    border-radius: 50px;
    background-color: rgba(255, 255, 255, 0.12);
    transition: var(--transition-smooth);
    pointer-events: none;
}

.cc-switch i::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--text-primary);
    transition: var(--transition-smooth);
}

.cc-switch input:checked + i {
    background-color: var(--accent-color);
}

.cc-switch input:checked + i::after {
    transform: translateX(20px);
    background-color: var(--bg-color);
}

.cc-switch input:disabled {
    cursor: not-allowed;
}

.cc-switch input:disabled + i {
    opacity: 0.5;
}

/* Footer link to reopen settings */
.cc-settings-link {
    display: inline-block;
    margin-top: 0.75rem;
    margin-right: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.cc-settings-link:hover {
    color: var(--accent-color);
}

@media (max-width: 600px) {
    .cookie-consent {
        left: 0.75rem;
        bottom: 0.75rem;
        width: calc(100% - 1.5rem);
        max-height: calc(100vh - 1.5rem);
        overflow-y: auto;
    }

    .cc-inner { padding: 1.25rem; }
    .cc-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-consent { animation: none; }
    .cc-btn, .cc-switch i, .cc-switch i::after { transition: none; }
}
