/**
 * CMP - Cookie Management Platform
 * RGPD-compliant cookie consent banner and modal
 */

/* ========== Banner Styles ========== */
.cmp-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 999999;
    display: none;
    animation: cmpSlideUp 0.4s ease;
}

.cmp-banner.cmp-visible {
    display: block;
}

@keyframes cmpSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cmp-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cmp-banner-text {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.cmp-banner-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.cmp-banner-message h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.cmp-banner-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

.cmp-banner-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cmp-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
}

.cmp-btn-reject {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cmp-btn-reject:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.cmp-btn-customize {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.cmp-btn-customize:hover {
    background: rgba(255, 255, 255, 0.25);
}

.cmp-btn-accept {
    background: linear-gradient(135deg, #659d44 0%, #4a7832 100%);
    color: #fff;
}

.cmp-btn-accept:hover {
    background: linear-gradient(135deg, #74b34f 0%, #568a3c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(101, 157, 68, 0.4);
}

/* ========== Modal Styles ========== */
.cmp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cmp-modal-overlay.cmp-visible {
    display: flex;
    animation: cmpFadeIn 0.3s ease;
}

@keyframes cmpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cmp-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: cmpModalSlide 0.3s ease;
}

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

.cmp-modal-header {
    padding: 24px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cmp-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.cmp-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.cmp-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cmp-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.cmp-modal-intro {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cmp-modal-intro p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* ========== Cookie Category Styles ========== */
.cmp-category {
    margin-bottom: 16px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.cmp-category:hover {
    border-color: #ccc;
}

.cmp-category-header {
    padding: 16px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.cmp-category-info {
    flex: 1;
}

.cmp-category-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cmp-category-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #659d44;
    color: #fff;
    font-weight: 500;
}

.cmp-category-badge.cmp-badge-required {
    background: #6c757d;
}

.cmp-category-desc {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
    line-height: 1.4;
}

/* Toggle Switch */
.cmp-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.cmp-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cmp-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: all 0.3s ease;
    border-radius: 28px;
}

.cmp-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cmp-toggle input:checked + .cmp-toggle-slider {
    background-color: #659d44;
}

.cmp-toggle input:checked + .cmp-toggle-slider:before {
    transform: translateX(24px);
}

.cmp-toggle input:disabled + .cmp-toggle-slider {
    background-color: #659d44;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Category Details (Expandable) */
.cmp-category-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fff;
}

.cmp-category.cmp-expanded .cmp-category-details {
    max-height: 200px;
}

.cmp-category-details-inner {
    padding: 16px;
    border-top: 1px solid #e5e5e5;
}

.cmp-cookies-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cmp-cookie-tag {
    font-size: 12px;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 4px;
    color: #666;
    font-family: monospace;
}

.cmp-category-expand {
    background: none;
    border: none;
    color: #659d44;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    margin-top: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.cmp-category-expand:hover {
    background: rgba(101, 157, 68, 0.1);
}

/* ========== Modal Footer ========== */
.cmp-modal-footer {
    padding: 20px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.cmp-btn-save {
    background: linear-gradient(135deg, #659d44 0%, #4a7832 100%);
    color: #fff;
    padding: 12px 28px;
}

.cmp-btn-save:hover {
    background: linear-gradient(135deg, #74b34f 0%, #568a3c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(101, 157, 68, 0.4);
}

/* ========== Footer Link ========== */
.cmp-footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
    cursor: pointer;
}

.cmp-footer-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* Footer link for light backgrounds */
.footer-widget-list .cmp-footer-link {
    color: #666;
}

.footer-widget-list .cmp-footer-link:hover {
    color: #659d44;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .cmp-banner {
        padding: 16px;
    }

    .cmp-banner-content {
        gap: 12px;
    }

    .cmp-banner-text {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cmp-banner-icon {
        font-size: 28px;
    }

    .cmp-banner-message h3 {
        font-size: 16px;
    }

    .cmp-banner-message p {
        font-size: 13px;
    }

    .cmp-banner-buttons {
        justify-content: center;
        width: 100%;
    }

    .cmp-btn {
        padding: 10px 18px;
        font-size: 13px;
        flex: 1;
        min-width: 100px;
    }

    .cmp-modal {
        max-height: 90vh;
        border-radius: 12px;
    }

    .cmp-modal-header {
        padding: 18px;
    }

    .cmp-modal-header h2 {
        font-size: 18px;
    }

    .cmp-modal-body {
        padding: 18px;
    }

    .cmp-category-header {
        padding: 14px;
    }

    .cmp-category-title {
        font-size: 14px;
    }

    .cmp-category-desc {
        font-size: 12px;
    }

    .cmp-modal-footer {
        padding: 16px 18px;
        flex-wrap: wrap;
    }

    .cmp-btn-save {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cmp-banner-buttons {
        flex-direction: column;
    }

    .cmp-btn {
        width: 100%;
        text-align: center;
    }
}
