/* --- 0. ตัวแปรหลัก (จะถูก Override ด้วย Dynamic CSS) --- */
:root {
    --pdpa-banner-bg: #1a1a1a;
    --pdpa-banner-color: #ffffff;
    --pdpa-banner-link: #4da1ff;
    --pdpa-modal-bg: #ffffff;
    --pdpa-modal-color: #333333;
    --pdpa-modal-link: #005dff;
}

/* --- 1. Wrapper (ควบคุมตำแหน่ง) --- */
#psub-pdpa-wrapper {
    display: none; /* ซ่อนไว้ก่อน รอ JS */
    z-index: 9998;
}
#psub-pdpa-wrapper.show {
    display: block;
}

/* ตำแหน่ง: Footer */
#psub-pdpa-wrapper.pdpa-pos-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
}
#psub-pdpa-wrapper.pdpa-pos-footer .psub-pdpa-banner {
    border-radius: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

/* ตำแหน่ง: Header */
#psub-pdpa-wrapper.pdpa-pos-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}
#psub-pdpa-wrapper.pdpa-pos-header .psub-pdpa-banner {
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* ตำแหน่ง: Modal (กลางจอ) */
#psub-pdpa-wrapper.pdpa-pos-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* ซ่อนก่อน */
    justify-content: center;
    align-items: center;
    padding: 20px;
}
#psub-pdpa-wrapper.pdpa-pos-modal.show {
    display: flex; /* แสดงแบบ flex */
}
#psub-pdpa-wrapper.pdpa-pos-modal .psub-pdpa-banner {
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    max-width: 600px; /* จำกัดความกว้างเบื้องต้น */
    flex-direction: column; /* เรียงแนวตั้ง */
}


/* --- 2. Main PDPA Banner (แบนเนอร์หลัก) --- */
.psub-pdpa-banner {
    /* สไตล์สี/ฟอนต์ จะมาจาก Dynamic CSS */
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    line-height: 1.6;
}

.pdpa-banner-content {
    flex: 1;
    min-width: 300px;
}

.pdpa-banner-content p {
    margin: 0;
    /* font-size มาจาก Dynamic CSS */
}

.pdpa-banner-content a {
    text-decoration: underline;
    /* color มาจาก Dynamic CSS */
}

.pdpa-banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pdpa-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pdpa-btn-settings {
    background-color: #4a4a4a;
    color: #ffffff;
}
.pdpa-btn-settings:hover {
    background-color: #6a6a6a;
}

.pdpa-btn-accept {
    background-color: #005dff; /* สีหลัก (ปุ่มยอมรับคงที่) */
    color: #ffffff;
}
.pdpa-btn-accept:hover {
    background-color: #004ecc;
}


/* --- 3. Settings Modal (หน้าต่างตั้งค่า) --- */
.psub-pdpa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none; /* ซ่อนไว้ */
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.psub-pdpa-modal-overlay.show {
    display: flex;
}

.psub-pdpa-modal-content {
    /* สไตล์สี/ขนาด มาจาก Dynamic CSS */
    padding: 25px 30px;
    border-radius: 8px;
    width: 100%;
    height: auto;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.pdpa-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}
.pdpa-modal-close:hover {
    color: #333; /* ใช้สีของ Modal */
}

.pdpa-modal-content h3 {
    margin-top: 0;
    color: inherit; /* ใช้สีฟอนต์ของ Modal */
}

.pdpa-cookie-item {
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(0,0,0,0.05); /* สีพื้นหลังจางๆ */
    border-radius: 5px;
}

.pdpa-cookie-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    cursor: pointer;
}

.pdpa-cookie-description {
    font-size: 13px;
    color: inherit; /* ใช้สีฟอนต์ของ Modal */
    margin: 5px 0 0 26px; /* ย่อหน้าตาม checkbox */
}
.pdpa-cookie-description p {
    margin: 0;
}
.pdpa-cookie-description a {
    text-decoration: underline;
}

.pdpa-modal-actions {
    text-align: right;
    margin-top: 20px;
}

/* --- 4. Revoke Link (ลิงก์ถอนความยินยอม) --- */
.pdpa-revoke-link {
    cursor: pointer;
    color: #005dff;
    text-decoration: underline;
    font-weight: bold;
}