/**
 * Cookie Consent Banner Styles
 * GDPR-compliant cookie consent UI
 *
 * @package Isomate_SaaS
 * @since 1.1.0
 */

/* Base Banner Styles */
.cookie-consent {
    position: fixed;
    z-index: 999999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

.cookie-consent *,
.cookie-consent *::before,
.cookie-consent *::after {
    box-sizing: inherit;
}

.cookie-consent__container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 20px 24px;
    max-width: 100%;
}

/* Position Variants */
.cookie-consent--bottom {
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0;
}

.cookie-consent--bottom .cookie-consent__container {
    border-radius: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
}

.cookie-consent--top {
    top: 0;
    left: 0;
    right: 0;
    padding: 0;
}

.cookie-consent--top .cookie-consent__container {
    border-radius: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
}

.cookie-consent--bottom-left {
    bottom: 20px;
    left: 20px;
    max-width: 400px;
}

.cookie-consent--bottom-right {
    bottom: 20px;
    right: 20px;
    max-width: 400px;
}

.cookie-consent--center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 500px;
    width: calc(100% - 40px);
}

.cookie-consent--center::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* Style Variants */
.cookie-consent--bar .cookie-consent__container {
    border-radius: 0;
}

.cookie-consent--box .cookie-consent__container {
    border-radius: 12px;
}

.cookie-consent--modal .cookie-consent__container {
    border-radius: 16px;
    padding: 24px 28px;
}

/* Content */
.cookie-consent__content {
    flex: 1;
    min-width: 200px;
}

.cookie-consent__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1a1a2e;
}

.cookie-consent--bottom .cookie-consent__title,
.cookie-consent--top .cookie-consent__title {
    display: none;
}

.cookie-consent__text {
    margin: 0;
    color: #4a4a68;
    font-size: 14px;
}

.cookie-consent__links {
    margin: 8px 0 0 0;
    font-size: 13px;
}

.cookie-consent__links a {
    color: var(--isomate-primary, #4f46e5);
    text-decoration: none;
    margin-right: 16px;
}

.cookie-consent__links a:hover {
    text-decoration: underline;
}

/* Cookie Categories */
.cookie-consent__categories {
    margin: 16px 0;
    padding: 16px 0;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
}

.cookie-category {
    margin-bottom: 12px;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

.cookie-category__label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #1a1a2e;
}

.cookie-category__label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--isomate-primary, #4f46e5);
    cursor: pointer;
}

.cookie-category__label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.cookie-category__name {
    flex: 1;
}

.cookie-category__badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 4px;
}

.cookie-category__desc {
    margin: 4px 0 0 26px;
    font-size: 13px;
    color: #6b6b80;
}

/* Actions */
.cookie-consent__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cookie-consent--bottom .cookie-consent__actions,
.cookie-consent--top .cookie-consent__actions {
    flex-shrink: 0;
}

.cookie-consent__btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.cookie-consent__btn--primary {
    background: var(--isomate-primary, #4f46e5);
    color: #ffffff;
}

.cookie-consent__btn--primary:hover {
    background: var(--isomate-primary-dark, #4f46e5);
}

.cookie-consent__btn--secondary {
    background: #f5f5f7;
    color: #1a1a2e;
    border: 1px solid #e0e0e0;
}

.cookie-consent__btn--secondary:hover {
    background: #ebebed;
}

.cookie-consent__actions--save {
    width: 100%;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
}

/* Expanded State */
.cookie-consent.is-expanded .cookie-consent__categories {
    display: block !important;
}

.cookie-consent.is-expanded .cookie-consent__actions:not(.cookie-consent__actions--save) {
    display: none !important;
}

.cookie-consent.is-expanded .cookie-consent__actions--save {
    display: flex !important;
}

/* Animation */
.cookie-consent {
    animation: cookieSlideIn 0.3s ease-out;
}

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

.cookie-consent--center {
    animation: cookieFadeIn 0.3s ease-out;
}

@keyframes cookieFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.cookie-consent.is-hiding {
    animation: cookieSlideOut 0.2s ease-in forwards;
}

@keyframes cookieSlideOut {
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Trust Badges */
.trust-badges {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
}

.trust-badge:hover {
    color: #ffffff;
}

.trust-badge__icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-consent--bottom .cookie-consent__container,
    .cookie-consent--top .cookie-consent__container {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .cookie-consent__actions {
        justify-content: center;
    }

    .cookie-consent--bottom-left,
    .cookie-consent--bottom-right {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .cookie-consent__btn {
        flex: 1;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .cookie-consent__container {
        padding: 16px;
    }

    .cookie-consent__btn {
        padding: 12px 16px;
        font-size: 13px;
    }

    .cookie-consent__actions {
        flex-direction: column;
    }

    .cookie-consent__btn {
        width: 100%;
    }
}

/* Accessibility */
.cookie-consent__btn:focus {
    outline: 2px solid var(--isomate-primary, #4f46e5);
    outline-offset: 2px;
}

.cookie-consent__btn:focus:not(:focus-visible) {
    outline: none;
}

.cookie-category__label input[type="checkbox"]:focus {
    outline: 2px solid var(--isomate-primary, #4f46e5);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .cookie-consent__container {
        border: 2px solid #000;
    }

    .cookie-consent__btn--secondary {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent,
    .cookie-consent--center {
        animation: none;
    }

    .cookie-consent.is-hiding {
        animation: none;
        display: none;
    }
}

/* Print */
@media print {
    .cookie-consent {
        display: none !important;
    }
}
