/* Professional Cookie Manager Frontend Styles */

/* Base Variables - Overwritten by Plugin PHP */
:root {
    --pcm-primary: var(--pcm-light-primary, #0d6efd);
    --pcm-text: var(--pcm-light-text, #333333);
    --pcm-bg: var(--pcm-light-bg, #ffffff);
    --pcm-font-size: 14px;
    --pcm-radius: 8px;
    /* Slightly softer */
    --pcm-overlay: rgba(0, 0, 0, 0.6);
    --pcm-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.2);
    --pcm-zindex: 999999;
}

/* Dark Mode Preference */
@media (prefers-color-scheme: dark) {
    :root {
        --pcm-primary: var(--pcm-dark-primary, #0b5ed7);
        --pcm-text: var(--pcm-dark-text, #f1f1f1);
        --pcm-bg: var(--pcm-dark-bg, #1e1e1e);
    }
}

/* --- Banner --- */
.pcm-banner {
    position: fixed;
    z-index: var(--pcm-zindex);
    background: var(--pcm-bg);
    color: var(--pcm-text);
    box-shadow: var(--pcm-shadow);
    padding: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--pcm-font-size);
    /* Glassmorphism attempt (might need rgba bg to work fully, but solid is safer for legibility) */
    /* backdrop-filter: blur(10px); */
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* Icon in banner */
.pcm-banner-icon {
    flex-shrink: 0;
    color: var(--pcm-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcm-banner p {
    margin: 0;
    max-width: 700px;
    line-height: 1.6;
    font-weight: 400;
}

.pcm-banner a {
    color: var(--pcm-primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.pcm-banner a:hover {
    border-bottom-color: currentColor;
}

/* Layouts */
.pcm-layout-bar {
    left: 0;
    right: 0;
}

.pcm-pos-bottom {
    bottom: 0;
    animation: pcmSlideUp 0.4s ease-out;
}

.pcm-pos-top {
    top: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-top: none;
    animation: pcmSlideDown 0.4s ease-out;
}

.pcm-layout-corner {
    width: 380px;
    border-radius: var(--pcm-radius);
    padding: 30px;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* For corner layout */
.pcm-layout-corner.pcm-pos-bottom {
    bottom: 20px;
    right: 20px;
    animation: pcmFadeInUp 0.4s ease-out;
}

.pcm-layout-corner.pcm-pos-top {
    top: 20px;
    right: 20px;
    animation: pcmFadeInDown 0.4s ease-out;
}

.pcm-layout-corner .pcm-banner-icon {
    margin-bottom: 15px;
}

.pcm-layout-corner .pcm-actions {
    width: 100%;
    flex-direction: column;
}

.pcm-layout-corner .pcm-btn {
    width: 100%;
    justify-content: center;
}

/* Centered Popup */
.pcm-layout-popup {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 480px;
    border-radius: var(--pcm-radius);
    flex-direction: column;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
    animation: pcmZoomIn 0.3s ease-out;
}

.pcm-layout-popup .pcm-banner-icon {
    margin-bottom: 20px;
    width: 100%;
}

.pcm-layout-popup .pcm-actions {
    justify-content: center;
    margin-top: 10px;
}

/* Actions */
.pcm-actions {
    display: flex;
    gap: 12px;
}

.pcm-btn {
    padding: 10px 20px;
    border-radius: var(--pcm-radius);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.pcm-btn svg {
    pointer-events: none;
}

.pcm-btn-primary {
    background-color: var(--pcm-primary);
    color: #fff;
    border-color: var(--pcm-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.pcm-btn-primary:hover {
    background-color: var(--pcm-primary);
    /* Slight darkening handled by opacity */
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pcm-btn-outline {
    background-color: transparent;
    border-color: rgba(0, 0, 0, 0.2);
    color: var(--pcm-text);
}

.pcm-btn-outline:hover {
    border-color: var(--pcm-text);
    background-color: rgba(0, 0, 0, 0.03);
}

/* --- Modal --- */
.pcm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--pcm-overlay);
    z-index: var(--pcm-zindex);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Display block/flex handled by JS, but opactiy for transition */
.pcm-modal[style*="display: flex"] {
    opacity: 1;
    pointer-events: auto;
}

.pcm-modal-content {
    background: var(--pcm-bg);
    color: var(--pcm-text);
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    border-radius: var(--pcm-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--pcm-shadow);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.pcm-modal[style*="display: flex"] .pcm-modal-content {
    transform: scale(1);
}

.pcm-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.01);
}

.pcm-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    color: var(--pcm-text);
    /* Force color inheritance for dark mode */
}

/* Specific style for title text to allow stacking */
.pcm-modal-title-text {
    display: inline-block;
    max-width: 15rem;
    /* Force wrapping for longer titles */
    line-height: 1.2;
    margin-left: 5px;
    vertical-align: middle;
}

#pcm-close-modal {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--pcm-text);
    /* Force color */
    opacity: 0.6;
    transition: opacity 0.2s;
}

#pcm-close-modal:hover {
    opacity: 1;
}

.pcm-modal-body {
    padding: 30px;
    overflow-y: auto;
}

.pcm-category-item {
    background: rgba(0, 0, 0, 0.02);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    transition: background 0.2s;
}

.pcm-category-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

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

/* Specific category highlights */
.pcm-cat-necessary {
    border-left: 4px solid #198754;
}

/* Green */

.pcm-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pcm-cat-title {
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pcm-cat-status {
    font-size: 12px;
    background: #198754;
    color: #fff;
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.pcm-cat-desc {
    font-size: 14px;
    opacity: 0.8;
    margin: 0;
    line-height: 1.5;
}

.pcm-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    text-align: right;
    background-color: rgba(0, 0, 0, 0.01);
}

/* Switch */
.pcm-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.pcm-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.pcm-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.pcm-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.pcm-slider {
    background-color: var(--pcm-primary);
}

input:focus+.pcm-slider {
    box-shadow: 0 0 1px var(--pcm-primary);
}

input:checked+.pcm-slider:before {
    -webkit-transform: translateX(24px);
    -ms-transform: translateX(24px);
    transform: translateX(24px);
}

.pcm-slider.round {
    border-radius: 34px;
}

.pcm-slider.round:before {
    border-radius: 50%;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pcmSlideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pcmFadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pcmFadeInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pcmZoomIn {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .pcm-banner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .pcm-banner-icon {
        margin-bottom: 15px;
    }

    .pcm-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .pcm-btn {
        width: 100%;
        justify-content: center;
    }
}