/**
 * Custom styles for Cookie Consent
 * Salamanca Acompaña
 */

:root {
    --cc-primary-color: #007bff;
    --cc-secondary-color: #6c757d;
    --cc-bg-color: #ffffff;
    --cc-text-color: #212529;
    --cc-border-radius: 0.5rem;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --cc-bg-color: #343a40;
        --cc-text-color: #f8f9fa;
    }
}

/* Consent Modal */
#cc-main .cm {
    background: var(--cc-bg-color);
    color: var(--cc-text-color);
    border-radius: var(--cc-border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    font-family: 'Open Sans', sans-serif;
}

#cc-main .cm__title {
    color: var(--cc-text-color);
    font-weight: 700;
    font-size: 1.25rem;
}

#cc-main .cm__desc {
    color: var(--cc-secondary-color);
    line-height: 1.5;
}

/* Primary button */
#cc-main .cm__btn.cm__btn--primary {
    background: var(--cc-primary-color);
    border-color: var(--cc-primary-color);
    color: white;
    border-radius: calc(var(--cc-border-radius) / 2);
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

#cc-main .cm__btn.cm__btn--primary:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* Secondary button */
#cc-main .cm__btn.cm__btn--secondary {
    background: transparent;
    border-color: var(--cc-secondary-color);
    color: var(--cc-secondary-color);
    border-radius: calc(var(--cc-border-radius) / 2);
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

#cc-main .cm__btn.cm__btn--secondary:hover {
    background: var(--cc-secondary-color);
    color: white;
    transform: translateY(-1px);
}

/* Settings Modal */
#cc-main .pm {
    background: var(--cc-bg-color);
    color: var(--cc-text-color);
    font-family: 'Open Sans', sans-serif;
}

#cc-main .pm__title {
    color: var(--cc-text-color);
    font-weight: 700;
}

#cc-main .pm__section-title {
    color: var(--cc-text-color);
    font-weight: 600;
}

#cc-main .pm__section-desc {
    color: var(--cc-secondary-color);
    line-height: 1.5;
}

/* Toggle switch */
#cc-main .sc__toggle-checkbox:checked ~ .sc__toggle-switch {
    background: var(--cc-primary-color);
}

#cc-main .sc__toggle-switch {
    background: var(--cc-secondary-color);
    transition: background 0.3s ease;
}

/* Links */
#cc-main .cc-link {
    color: var(--cc-primary-color);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.3s ease;
}

#cc-main .cc-link:hover {
    color: #0056b3;
}

/* Cookie table */
#cc-main .sc__cookie-table {
    background: #f8f9fa;
    border-radius: calc(var(--cc-border-radius) / 2);
    margin-top: 0.75rem;
}

#cc-main .sc__cookie-table tbody tr {
    border-bottom: 1px solid #dee2e6;
}

#cc-main .sc__cookie-table tbody tr:last-child {
    border-bottom: none;
}

#cc-main .sc__cookie-table td {
    padding: 0.5rem;
    font-size: 0.875rem;
}

/* Buttons in settings modal */
#cc-main .pm__btn {
    border-radius: calc(var(--cc-border-radius) / 2);
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

#cc-main .pm__btn--primary {
    background: var(--cc-primary-color);
    border-color: var(--cc-primary-color);
}

#cc-main .pm__btn--primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

#cc-main .pm__btn--secondary {
    background: transparent;
    border-color: var(--cc-secondary-color);
    color: var(--cc-secondary-color);
}

#cc-main .pm__btn--secondary:hover {
    background: var(--cc-secondary-color);
    color: white;
}

/* Close button */
#cc-main .pm__close-btn {
    background: transparent;
    color: var(--cc-secondary-color);
    transition: color 0.3s ease;
}

#cc-main .pm__close-btn:hover {
    color: var(--cc-text-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #cc-main .cm {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    #cc-main .cm__title {
        font-size: 1.1rem;
    }

    #cc-main .cm__desc {
        font-size: 0.9rem;
    }

    #cc-main .cm__btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    #cc-main .pm {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    #cc-main .cm__btns {
        flex-direction: column;
        gap: 0.5rem;
    }

    #cc-main .cm__btn {
        width: 100%;
    }
}

/* Animation improvements */
#cc-main .cm,
#cc-main .pm {
    animation-duration: 0.3s;
}

/* Focus states for accessibility */
#cc-main .cm__btn:focus,
#cc-main .pm__btn:focus,
#cc-main .cc-link:focus {
    outline: 2px solid var(--cc-primary-color);
    outline-offset: 2px;
}

/* Toggle switch accessibility */
#cc-main .sc__toggle:focus-within {
    outline: 2px solid var(--cc-primary-color);
    outline-offset: 2px;
    border-radius: 2rem;
}

/* Floating Toggle Button */
.c-settings {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999999;
    background: var(--cc-primary-color);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.c-settings:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.3);
}

.c-settings:focus {
    outline: 2px solid var(--cc-primary-color);
    outline-offset: 2px;
}

/* Icon for floating button (optional cookie emoji) */
.c-settings::before {
    content: '🍪 ';
    margin-right: 0.25rem;
}

/* Responsive floating button */
@media (max-width: 768px) {
    .c-settings {
        bottom: 15px;
        left: 15px;
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .c-settings {
        bottom: 10px;
        left: 10px;
        padding: 0.5rem 0.9rem;
        font-size: 0.8rem;
    }

    .c-settings::before {
        content: '🍪';
        margin-right: 0;
    }
}
