/**
 * Manager Cookie Consent - Styles
 *
 * BEM naming convention with CSS custom properties for easy theming
 * To customize, copy this file to your theme and enable "Disable Plugin CSS" option.
 *
 * @package ManagerCookieConsent
 */

/* CSS Custom Properties */
:root {
    --mcc-background: #f6f3ef;
    --mcc-text: #111928;
    --mcc-button-primary: #27779e;
    --mcc-button-primary-text: #ffffff;
    --mcc-button-secondary: #998575;
    --mcc-button-secondary-text: #ffffff;
    --mcc-border-radius: 0.5rem;
    --mcc-z-index: 9999;
    --mcc-overlay-bg: rgba(0, 0, 0, 0.5);
    --mcc-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    --mcc-transition: 0.3s ease;
}


/* Banner Block */
.mcc-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: var(--mcc-z-index);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--mcc-text);
}

.mcc-banner--bottom {
    bottom: 0;
}

.mcc-banner--top {
    top: 0;
}

/* Overlay */
.mcc-banner__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--mcc-overlay-bg);
    opacity: 0;
    transition: opacity var(--mcc-transition);
    pointer-events: none;
}

.mcc-banner--popup .mcc-banner__overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Container */
.mcc-banner__container {
    background: var(--mcc-background);
    box-shadow: var(--mcc-shadow);
    max-width: 100%;
    margin: 0 auto;
    animation: mccSlideIn var(--mcc-transition);
}

.mcc-banner--bar .mcc-banner__container {
    border-radius: 0;
}

.mcc-banner--popup .mcc-banner__container {
    position: relative;
    max-width: 600px;
    margin: 2rem auto;
    border-radius: var(--mcc-border-radius);
}

.mcc-banner--bottom.mcc-banner--bar .mcc-banner__container {
    animation: mccSlideInBottom var(--mcc-transition);
}

.mcc-banner--top.mcc-banner--bar .mcc-banner__container {
    animation: mccSlideInTop var(--mcc-transition);
}

/* Content */
.mcc-banner__content {
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .mcc-banner__content {
        padding: 1.5rem 2rem;
    }
}

/* Header */
.mcc-banner__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0;
}

.mcc-banner__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    font-family: 'Ubuntu';
}

@media (min-width: 768px) {
    .mcc-banner__title {
        font-size: 1.25rem;
    }
}

.mcc-banner__close {
    background: transparent;
    border: none;
    color: var(--mcc-text);
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 1rem;
    opacity: 0.7;
    transition: opacity var(--mcc-transition);
    flex-shrink: 0;
}

.mcc-banner__close:hover,
.mcc-banner__close:focus {
    opacity: 1;
}

/* Body */
.mcc-banner__body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;

    @media (min-width: 768px) {
        flex-direction: row;
    }
}

.mcc-banner__description {
    margin: 0;
    opacity: 0.9;
}

.mcc-banner__privacy-link {
    margin: 0 1rem;
    display: flex;
    align-items: center;
}

.mcc-banner__privacy-link a {
    color: var(--mcc-text);
    text-decoration: underline;
    opacity: 0.8;
    transition: opacity var(--mcc-transition);
}

.mcc-banner__privacy-link a:hover,
.mcc-banner__privacy-link a:focus {
    opacity: 1;
}

/* Buttons */
.mcc-banner__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;

    @media (min-width: 768px) {
        margin-top: 0;
    }
}

.mcc-banner__buttons--simple {
    justify-content: flex-start;
}

.mcc-banner__buttons--detailed {
    justify-content: flex-start;
}

@media (max-width: 767px) {
    .mcc-banner__buttons {
        justify-content: center;
    }
}

.mcc-banner__button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--mcc-border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--mcc-transition);
    white-space: nowrap;
}

@media (max-width: 767px) {
    .mcc-banner__button {
        width: 100%;
    }
}

.mcc-banner__button--primary {
    background: var(--mcc-button-primary);
    color: var(--mcc-button-primary-text);
}

.mcc-banner__button--primary:hover,
.mcc-banner__button--primary:focus {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mcc-banner__button--secondary {
    background: var(--mcc-button-secondary);
    color: var(--mcc-button-secondary-text);
}

.mcc-banner__button--secondary:hover,
.mcc-banner__button--secondary:focus {
    filter: brightness(1.1);
}

.mcc-banner__button--text {
    background: transparent;
    color: var(--mcc-text);
    text-decoration: underline;
    padding: 0.75rem 1rem;
}

.mcc-banner__button--text:hover,
.mcc-banner__button--text:focus {
    opacity: 0.8;
}

/* Detailed View */
.mcc-banner__detailed {
    margin-top: 1.5rem;
}

.mcc-banner__categories {
    margin-bottom: 1.5rem;
}

/* Category */
.mcc-category {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--mcc-border-radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.mcc-category__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
}

.mcc-category__label {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex: 1;
    margin: 0;
}

.mcc-category__checkbox {
    margin: 0 0.75rem 0 0;
    cursor: pointer;
    width: 1.25rem;
    height: 1.25rem;
}

.mcc-category__checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.mcc-category__name {
    font-weight: 600;
}

.mcc-category__required {
    font-size: 0.875rem;
    opacity: 0.7;
    font-weight: 400;
    margin-left: 0.5rem;
}

.mcc-category__toggle {
    background: transparent;
    border: none;
    color: var(--mcc-text);
    cursor: pointer;
    padding: 0.5rem;
    opacity: 0.7;
    transition: all var(--mcc-transition);
    flex-shrink: 0;
}

.mcc-category__toggle:hover,
.mcc-category__toggle:focus {
    opacity: 1;
}

.mcc-category__toggle--active {
    transform: rotate(180deg);
}

.mcc-category__description {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
    font-size: 0.875rem;
}

.mcc-category__description p {
    margin: 0;
}

/* Manage Button (floating) */
.mcc-manage-button {
    position: fixed;
    bottom: 80px;
    left: 1rem;
    z-index: calc(var(--mcc-z-index) - 1);
    background: var(--mcc-background);
    color: var(--mcc-text);
    border: none;
    border-radius: var(--mcc-border-radius);
    padding: 0.75rem 1rem;
    cursor: pointer;
    box-shadow: var(--mcc-shadow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--mcc-transition);
    font-size: 0.875rem;
    font-weight: 600;

    @media all and (min-width: 1024px) {
        bottom: 20px;
    }
}

.mcc-manage-button:hover,
.mcc-manage-button:focus {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.mcc-manage-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .mcc-manage-button__text {
        display: none;
    }

    .mcc-manage-button {
        padding: 0.75rem;
        border-radius: 50%;
        width: 3rem;
        height: 3rem;
        justify-content: center;
    }
}

/* Animations */
@keyframes mccSlideInBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes mccSlideInTop {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes mccSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Accessibility */
/*.mcc-banner:focus-within {*/
/*    outline: 2px solid var(--mcc-button-primary);*/
/*    outline-offset: -2px;*/
/*}*/

@media (prefers-reduced-motion: reduce) {
    .mcc-banner *,
    .mcc-banner *::before,
    .mcc-banner *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .mcc-banner {
        border: 2px solid currentColor;
    }

    .mcc-category {
        border-width: 2px;
    }
}

/* Dark mode adjustments (if theme uses dark mode) */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode by default */
}

/* Print */
@media print {
    .mcc-banner,
    .mcc-manage-button {
        display: none !important;
    }
}

/* RTL Support */
[dir="rtl"] .mcc-banner__close {
    margin-left: 0;
    margin-right: 1rem;
}

[dir="rtl"] .mcc-category__checkbox {
    margin: 0 0 0 0.75rem;
}

[dir="rtl"] .mcc-manage-button {
    left: auto;
    right: 1rem;
}
