/**
 * DD Consent Plugin Styles
 * Cookie consent popup styling
 */

#dd-consent-popup {
    z-index: 10000000;
    position: fixed;
    padding: 1em;
    max-width: 400px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    font-size: 15px;
    box-shadow: rgba(23, 43, 99, 0.4) 0 7px 28px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Position variants */
#dd-consent-popup.bottom-right {
    bottom: 3%;
    right: 2%;
}

#dd-consent-popup.bottom-left {
    bottom: 3%;
    left: 2%;
}

#dd-consent-popup.bottom-center {
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
}

#dd-consent-popup.top-right {
    top: 3%;
    right: 2%;
}

#dd-consent-popup.top-left {
    top: 3%;
    left: 2%;
}

#dd-consent-popup.top-center {
    top: 3%;
    left: 50%;
    transform: translateX(-50%);
}

/* Mobile responsive */
@media (max-width: 600px) {
    #dd-consent-popup {
        border-radius: 0;
        max-width: 100%;
        right: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        transform: none !important;
    }
    
    #dd-consent-popup.top-right,
    #dd-consent-popup.top-left,
    #dd-consent-popup.top-center {
        top: 0 !important;
        bottom: auto !important;
    }
}

#dd-consent-popup a {
    font-size: 15px;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
    color: inherit;
}

#dd-consent-popup a:hover {
    opacity: 0.7;
}

#dd-consent-popup .dd-consent-message {
    margin: 0;
    color: #000;
    padding-right: 50px;
    line-height: 1.4;
}

#dd-consent-popup .dd-consent-button {
    position: absolute;
    right: 0.5em;
    top: 20px;
    align-self: center;
    line-height: 1;
    color: #fff;
    background-color: #000;
    border: none;
    opacity: 0.6;
    font-size: 12px;
    cursor: pointer;
    border-radius: 50px;
    padding: 8px 12px;
    transition: opacity 0.2s ease;
}

#dd-consent-popup .dd-consent-button:hover {
    opacity: 1;
}

#dd-consent-popup .dd-consent-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Animation for popup appearance */
#dd-consent-popup.dd-consent-show {
    animation: ddConsentSlideIn 0.3s ease-out;
}

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

/* Animation for popup disappearance */
#dd-consent-popup.dd-consent-hide {
    animation: ddConsentSlideOut 0.3s ease-in;
}

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

/* RTL (Right-to-Left) Support */
[dir="rtl"] #dd-consent-popup .dd-consent-message {
    padding-right: 0;
    padding-left: 50px;
    text-align: right;
    direction: rtl;
}

[dir="rtl"] #dd-consent-popup .dd-consent-button {
    right: auto;
    left: 0.5em;
}

/* RTL Position variants - mirror the positions */
[dir="rtl"] #dd-consent-popup.bottom-right {
    right: auto;
    left: 2%;
}

[dir="rtl"] #dd-consent-popup.bottom-left {
    left: auto;
    right: 2%;
}

[dir="rtl"] #dd-consent-popup.top-right {
    right: auto;
    left: 2%;
}

[dir="rtl"] #dd-consent-popup.top-left {
    left: auto;
    right: 2%;
}

/* RTL Mobile responsive adjustments */
@media (max-width: 600px) {
    [dir="rtl"] #dd-consent-popup {
        direction: rtl;
    }
    
    [dir="rtl"] #dd-consent-popup .dd-consent-message {
        padding-left: 50px;
        padding-right: 0;
    }
    
    [dir="rtl"] #dd-consent-popup .dd-consent-button {
        left: 0.5em;
        right: auto;
    }
}

/* Additional RTL text styling */
[dir="rtl"] #dd-consent-popup a {
    direction: rtl;
}

/* Ensure proper text flow in RTL */
[dir="rtl"] #dd-consent-popup {
    direction: rtl;
    text-align: right;
}

/* Override for LTR content within RTL context if needed */
[dir="rtl"] #dd-consent-popup .ltr-content {
    direction: ltr;
    text-align: left;
}
