/* Maple GDPR Cookies - Frontend Styles */

.mgc-notice {
    position: fixed;
    z-index: 999999;
    background: #fff;
    color: #1d2327;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    padding: 20px;
    max-width: 100%;
    box-sizing: border-box;
}

.mgc-notice.mgc-position-bottom {
    bottom: 0;
    left: 0;
    right: 0;
}

.mgc-notice.mgc-position-top {
    top: 0;
    left: 0;
    right: 0;
}

.mgc-notice.mgc-position-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 600px;
    border-radius: 8px;
}

.mgc-notice.mgc-theme-dark {
    background: #1d2327;
    color: #fff;
}

.mgc-notice.mgc-theme-dark a {
    color: #7cc5ff;
}

.mgc-notice-content {
    margin-bottom: 15px;
    line-height: 1.6;
}

.mgc-notice-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons: all defaults are WCAG 2.1 AA (contrast ≥ 4.5:1) against white text. */
.mgc-button {
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    background: #135e96;
    color: #fff;
}

.mgc-button:hover {
    background: #0a4a79;
}

/* Button Color Variants (each validated for AA text contrast on white label) */
.mgc-button-color-blue {
    background: #135e96;
}
.mgc-button-color-blue:hover {
    background: #0a4a79;
}

.mgc-button-color-black {
    background: #000000;
}
.mgc-button-color-black:hover {
    background: #1a1a1a;
}

.mgc-button-color-dark-grey {
    background: #4a4a4a;
}
.mgc-button-color-dark-grey:hover {
    background: #2f2f2f;
}

.mgc-button-color-red {
    background: #b32d2e;
}
.mgc-button-color-red:hover {
    background: #8c1d1e;
}

.mgc-button-color-green {
    background: #1e7e4a;
}
.mgc-button-color-green:hover {
    background: #155c35;
}

/* Focus ring — respects user-visible focus mode and survives dark theme */
.mgc-button:focus-visible,
.mgc-floating-button:focus-visible,
.mgc-footer-preference-link:focus-visible,
.mgc-preferences-link:focus-visible,
.mgc-settings-content :focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #135e96;
}

.mgc-privacy-link {
    color: #135e96;
    text-decoration: underline;
    margin-left: 5px;
}

.mgc-privacy-link:hover {
    text-decoration: none;
}

/* Animations */
.mgc-animation-slide.mgc-position-bottom {
    animation: mgc-slide-up 0.5s ease-out;
}

.mgc-animation-slide.mgc-position-top {
    animation: mgc-slide-down 0.5s ease-out;
}

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

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

.mgc-animation-fade {
    animation: mgc-fade-in 0.5s ease-out;
}

@keyframes mgc-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Respect user's motion preference (WCAG 2.3.3, 2.2.2) */
@media (prefers-reduced-motion: reduce) {
    .mgc-notice,
    .mgc-settings-modal,
    .mgc-settings-content,
    .mgc-button,
    .mgc-floating-button,
    .mgc-footer-preference-link,
    .mgc-preferences-link {
        animation: none !important;
        transition: none !important;
    }
    .mgc-floating-button:hover {
        transform: none !important;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .mgc-notice {
        padding: 15px;
    }
    .mgc-notice-buttons {
        flex-direction: column;
    }
    .mgc-button {
        width: 100%;
    }
}

/* Hidden state */
.mgc-hidden {
    display: none !important;
}

/* Persistent Floating Cookie Settings Button */
.mgc-floating-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #135e96;
    color: #fff;
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999998;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.mgc-floating-button:hover {
    background: #0a4a79;
    transform: scale(1.1);
}

.mgc-floating-button svg {
    width: 24px;
    height: 24px;
}

/* Footer Preference Link (larger target + darker text for AA contrast on arbitrary backgrounds) */
.mgc-footer-preference-link {
    position: fixed;
    bottom: 10px;
    left: 10px;
    min-height: 24px;
    padding: 6px 10px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #1d2327;
    text-decoration: underline;
    background: #fff;
    border-radius: 3px;
    z-index: 999998;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease;
}

.mgc-footer-preference-link:hover {
    background: #f0f0f1;
    color: #135e96;
}

/* Shortcode Preference Link */
.mgc-preferences-link {
    color: #135e96;
    text-decoration: underline;
    font-size: 14px;
    cursor: pointer;
}

.mgc-preferences-link:hover {
    text-decoration: none;
}

/* Settings Modal */
.mgc-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    animation: mgc-fade-in 0.3s ease-out;
}

.mgc-settings-content {
    background: #fff;
    color: #1d2327;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: mgc-scale-in 0.3s ease-out;
}

.mgc-settings-content h2 {
    margin: 0 0 10px 0;
    font-size: 20px;
    line-height: 1.3;
}

@keyframes mgc-scale-in {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Category fieldsets — fieldset/legend gives screen readers a proper group semantic. */
.mgc-category {
    margin: 0 0 15px 0;
    padding: 12px 14px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #fff;
}

.mgc-category-legend {
    font-weight: 600;
    padding: 0 6px;
}

.mgc-category-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.mgc-category-row input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.mgc-category-desc {
    font-size: 13px;
    color: #3c434a;
    margin-top: 4px;
    line-height: 1.5;
}
