/* Frontend Cookie Notice Styles */

/* Base Notice Styles */
#pdesk-cookie-notice {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.pdesk-notice-container {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 24px 30px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    overflow: visible;
}

.pdesk-notice-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.pdesk-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    opacity: 0.8;
}

.pdesk-icon svg,
.pdesk-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Logo positioned on right in content */
.pdesk-notice-content .pdesk-icon-right {
    order: 2; /* Move to right side in flexbox */
}

/* Absolute positioned logos (outside content area) */
.pdesk-notice-container {
    position: relative;
}

.pdesk-icon-top-left,
.pdesk-icon-top-center,
.pdesk-icon-top-right,
.pdesk-icon-bottom-left,
.pdesk-icon-bottom-center,
.pdesk-icon-bottom-right {
    position: absolute;
    z-index: 10;
    width: 40px;
    height: 40px;
    opacity: 0.8;
}

.pdesk-icon-top-left {
    top: 10px;
    left: 10px;
}

.pdesk-icon-top-center {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.pdesk-icon-top-right {
    top: 10px;
    right: 10px;
}

.pdesk-icon-bottom-left {
    bottom: 10px;
    left: 10px;
}

.pdesk-icon-bottom-center {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.pdesk-icon-bottom-right {
    bottom: 10px;
    right: 10px;
}

/* Padding adjustments for absolute positioned logos are handled dynamically via PHP-generated CSS */

.pdesk-text-content {
    flex: 1;
}

.pdesk-banner-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.pdesk-message {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 1.6;
}

.pdesk-policy-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 10px;
    align-items: center;
}

.pdesk-policy-link {
    text-decoration: underline;
    font-weight: 500;
    transition: opacity 0.3s ease;
    font-size: 13px;
    padding: 0 12px;
    position: relative;
}

.pdesk-policy-link:first-child {
    padding-left: 0;
}

.pdesk-policy-link:last-child {
    padding-right: 0;
}

.pdesk-policy-link:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background-color: currentColor;
    opacity: 0.3;
}

.pdesk-policy-link:hover {
    opacity: 0.8;
}

/* Buttons */
.pdesk-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pdesk-btn {
    padding: 12px 28px;
    border: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

.pdesk-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pdesk-btn:active {
    transform: translateY(0);
}

/* Equal Choice Principle - Make Decline button as prominent as Accept */
.pdesk-btn-decline {
    flex: 1;
    min-width: 120px;
}

.pdesk-btn-accept {
    flex: 1;
    min-width: 120px;
}

.pdesk-btn-preferences {
    flex: 1;
    min-width: 120px;
}

/* Intentional Consent: 3 Equal Buttons */
.pdesk-btn-intentional {
    flex: 1;
    min-width: 120px;
    margin: 0 5px;
}

.pdesk-btn-intentional:first-child {
    margin-left: 0;
}

.pdesk-btn-intentional:last-child {
    margin-right: 0;
}

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

/* When intentional consent is enabled, ensure all 3 buttons are equal */
.pdesk-btn-intentional.pdesk-btn-none,
.pdesk-btn-intentional.pdesk-btn-some,
.pdesk-btn-intentional.pdesk-btn-all {
    flex: 1;
    min-width: 120px;
    width: 100%;
}

/* Positions */
.pdesk-position-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
}

.pdesk-position-top {
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
}

.pdesk-position-bottom-left {
    bottom: 20px;
    left: 20px;
    max-width: 400px;
}

.pdesk-position-bottom-right {
    bottom: 20px;
    right: 20px;
    max-width: 400px;
}

.pdesk-position-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 600px;
    width: 90%;
}

/* Layouts */
.pdesk-layout-banner .pdesk-notice-container {
    width: 100%;
}

.pdesk-layout-box .pdesk-notice-container {
    max-width: 500px;
}

.pdesk-layout-box .pdesk-notice-content {
    flex-direction: column;
    text-align: center;
}

.pdesk-layout-box .pdesk-icon {
    margin: 0 auto;
}

.pdesk-layout-box .pdesk-buttons {
    justify-content: center;
}

.pdesk-layout-modal .pdesk-notice-container {
    position: relative;
}

/* Overlay for Modal */
.pdesk-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* Animations */
.pdesk-animation-slide.pdesk-position-bottom {
    animation: slideUpIn 0.5s ease forwards;
}

.pdesk-animation-slide.pdesk-position-top {
    animation: slideDownIn 0.5s ease forwards;
}

.pdesk-animation-fade {
    animation: fadeIn 0.5s ease forwards;
}

.pdesk-animation-zoom {
    animation: zoomIn 0.5s ease forwards;
}

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

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

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Preferences Modal */
.pdesk-preferences-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pdesk-preferences-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.pdesk-preferences-content {
    position: relative;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: zoomIn 0.3s ease;
}

.pdesk-preferences-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.pdesk-preferences-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.pdesk-close-preferences {
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.pdesk-close-preferences:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.pdesk-close-preferences svg {
    width: 20px;
    height: 20px;
}

.pdesk-preferences-body {
    margin-bottom: 25px;
}

.pdesk-preferences-description {
    margin-bottom: 25px;
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.6;
}

.pdesk-cookie-category {
    margin-bottom: 15px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: none;
}

.pdesk-cookie-category:last-of-type {
    border-bottom: none;
}

.pdesk-cookie-category:hover {
    background: transparent;
}

.pdesk-category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.pdesk-category-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding-left: 10px;
    padding-right: 10px;
    margin-left: -10px;
    margin-right: -10px;
}

.pdesk-category-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    margin-right: 0;
    width: 20px;
    height: 20px;
}

.pdesk-category-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 20px;
    width: 20px;
    margin: 0;
    padding: 0;
    z-index: 2;
    top: 0;
    left: 0;
}

.pdesk-checkmark {
    position: absolute;
    height: 20px;
    width: 20px;
    min-width: 20px;
    min-height: 20px;
    background-color: transparent;
    border: 2px solid var(--pdesk-checkbox-border, rgba(0, 0, 0, 0.6));
    border-radius: 3px;
    transition: all 0.3s ease;
    display: block;
    flex-shrink: 0;
    top: 0;
    left: 0;
    z-index: 1;
    box-sizing: border-box;
}

.pdesk-category-checkbox:hover .pdesk-checkmark {
    border-color: var(--pdesk-checkbox-border, rgba(0, 0, 0, 0.8));
    opacity: 0.8;
}

.pdesk-category-checkbox input:checked ~ .pdesk-checkmark {
    background-color: var(--pdesk-checkbox-checked, #000000);
    border-color: var(--pdesk-checkbox-checked, #000000);
}

.pdesk-category-checkbox input:disabled ~ .pdesk-checkmark {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: var(--pdesk-checkbox-border, rgba(0, 0, 0, 0.3));
    opacity: 0.5;
    cursor: not-allowed;
}

.pdesk-checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.pdesk-category-checkbox input:checked ~ .pdesk-checkmark:after {
    display: block;
}

.pdesk-category-checkbox .pdesk-checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--pdesk-checkbox-checkmark, #ffffff);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.pdesk-category-checkbox input:checked ~ .pdesk-checkmark:after {
    border-color: var(--pdesk-checkbox-checkmark, #ffffff);
}

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

.pdesk-category-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.pdesk-category-info h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.pdesk-cookie-count {
    font-weight: 400;
    opacity: 0.7;
    font-size: 13px;
}

.pdesk-details-toggle {
    background: none;
    border: none;
    color: #4da6ff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    text-decoration: underline;
    transition: opacity 0.3s ease;
}

.pdesk-details-toggle:hover {
    opacity: 0.8;
}

.pdesk-category-details {
    padding: 0 0 15px 35px;
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.6;
    animation: slideDown 0.3s ease;
}

.pdesk-category-details p {
    margin: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 0.8;
        max-height: 200px;
    }
}

.pdesk-privacy-notice {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 20px;
}

.pdesk-privacy-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.pdesk-privacy-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.pdesk-checkmark-privacy {
    position: relative;
    height: 18px;
    width: 18px;
    background-color: transparent;
    border: 2px solid var(--pdesk-checkbox-border, rgba(0, 0, 0, 0.6));
    border-radius: 3px;
    margin-right: 10px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.pdesk-privacy-checkbox:hover .pdesk-checkmark-privacy {
    border-color: var(--pdesk-checkbox-border, rgba(0, 0, 0, 0.8));
    opacity: 0.8;
}

.pdesk-privacy-checkbox input:checked ~ .pdesk-checkmark-privacy {
    background-color: var(--pdesk-checkbox-checked, #000000);
    border-color: var(--pdesk-checkbox-checked, #000000);
}

.pdesk-checkmark-privacy:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid var(--pdesk-checkbox-checkmark, #ffffff);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.pdesk-privacy-checkbox input:checked ~ .pdesk-checkmark-privacy:after {
    display: block;
    border-color: var(--pdesk-checkbox-checkmark, #ffffff);
}

.pdesk-privacy-label {
    font-size: 14px;
    line-height: 1.4;
}

/* Privacy Paper */
.pdesk-privacy-paper {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--pdesk-link-color, #4da6ff);
}

.pdesk-privacy-paper h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.pdesk-privacy-paper-content {
    font-size: 14px;
    line-height: 1.8;
}

/* Privacy Contact */
.pdesk-privacy-contact {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.pdesk-privacy-contact h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.pdesk-privacy-contact-content {
    font-size: 14px;
    line-height: 1.8;
}

.pdesk-privacy-contact-content a {
    color: var(--pdesk-link-color, #4da6ff);
    text-decoration: underline;
}

/* Consent Duration */
.pdesk-consent-duration {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.pdesk-consent-duration h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

.pdesk-duration-select {
    width: 100%;
    max-width: 300px;
    padding: 10px 15px;
    border: 2px solid var(--pdesk-checkbox-border, rgba(0, 0, 0, 0.3));
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.pdesk-duration-select:focus {
    outline: none;
    border-color: var(--pdesk-link-color, #4da6ff);
}

/* Consent Metrics */
.pdesk-consent-metrics {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.pdesk-consent-metrics h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.pdesk-consent-metrics-content {
    font-size: 14px;
    line-height: 1.8;
}

.pdesk-consent-metrics-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.pdesk-consent-metrics-content li {
    margin: 5px 0;
}

.pdesk-preferences-footer {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    flex-wrap: wrap;
    position: relative;
}

.pdesk-preferences-footer .pdesk-btn {
    flex: 1;
    padding: 14px 28px;
}

.pdesk-powered-by {
    position: relative;
    top: 1px;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 15px;
    padding-top: 15px;
    line-height: 1;
    visibility: visible !important;
    opacity: 1;
    width: 100%;
}

.pdesk-powered-by-text {
    font-size: 11px;
    opacity: 0.8;
    color: var(--pdesk-text-color);
    display: inline-block;
}

img.pdesk-powered-by-logo {
    width: 50px;
}

.pdesk-powered-by-modal {
    width: 100%;
    text-align: right;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.pdesk-powered-by-modal .pdesk-powered-by-text {
    font-size: 11px;
    opacity: 0.8;
    color: var(--pdesk-text-color);
    display: inline-block;
}

.pdesk-powered-by-modal img.pdesk-powered-by-logo {
    width: 50px;
}

#pdesk-decline-all {
    order: 1;
}

#pdesk-accept-all {
    order: 2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pdesk-notice-content {
        flex-direction: column;
        text-align: center;
    }
    
    .pdesk-icon {
        margin: 0 auto;
    }
    
    .pdesk-buttons {
        flex-direction: column;
    }
    
    .pdesk-btn {
        width: 100%;
    }
    
    .pdesk-position-bottom-left,
    .pdesk-position-bottom-right {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .pdesk-preferences-content {
        padding: 20px;
    }
    
    .pdesk-preferences-header h2 {
        font-size: 20px;
    }
    
    .pdesk-preferences-footer {
        flex-direction: column;
    }
    
    .pdesk-powered-by {
        position: static;
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
    
    .pdesk-powered-by-modal {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .pdesk-notice-container {
        padding: 20px;
    }
    
    .pdesk-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .pdesk-cookie-category {
        padding: 15px;
    }
}

/* Accessibility */
.pdesk-screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.pdesk-screen-reader-text:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Accessibility - Focus styles */
.pdesk-btn:focus,
.pdesk-close-preferences:focus,
.pdesk-details-toggle:focus,
input[type="checkbox"]:focus,
.pdesk-category-checkbox input:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Accessibility - Skip link */
.pdesk-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 1000001;
}

.pdesk-skip-link:focus {
    top: 0;
}

/* Hide skip link when consent is given or banner is hidden */
#pdesk-cookie-notice[style*="display: none"] ~ .pdesk-skip-link,
.pdesk-skip-link.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Accessibility - Screen reader text */
.pdesk-screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.pdesk-screen-reader-text:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Smooth scrollbar for preferences modal */
.pdesk-preferences-content::-webkit-scrollbar {
    width: 8px;
}

.pdesk-preferences-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.pdesk-preferences-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.pdesk-preferences-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
