/* ============================================================
   DM Cookie Consent — styles
   No dependencies. Works on any WordPress theme.
   ============================================================ */

/* ─── Overlay ─────────────────────────────────────────────── */
#dm-cc-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #111;
}
#dm-cc-overlay[hidden] {
    display: none;
}

/* ─── Modal ───────────────────────────────────────────────── */
#dm-cc-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}
/* RTL support */
#dm-cc-modal[dir="rtl"] {
    font-family: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", system-ui, sans-serif;
    text-align: right;
}

/* ─── Header ──────────────────────────────────────────────── */
.dm-cc-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.dm-cc-header-copy { flex: 1; }
.dm-cc-header-copy h2 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #111;
    line-height: 1.2;
}
.dm-cc-header-copy p {
    margin: 0;
    font-size: 13px;
    color: #6b7a92;
    line-height: 1.5;
}
.dm-cc-header-btns {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-top: 2px;
}
.dm-cc-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e3e8ef;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
    line-height: 1;
    padding: 0;
    transition: background 0.15s;
}
.dm-cc-icon-btn:hover { background: #f5f5f5; }

/* ─── Tabs ────────────────────────────────────────────────── */
.dm-cc-tabs {
    display: flex;
    border-bottom: 2px solid #e3e8ef;
    margin: 16px 24px 0;
    gap: 0;
}
.dm-cc-tab {
    padding: 10px 20px;
    font-weight: 400;
    font-size: 14px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: #6b7a92;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
}
.dm-cc-tab.is-active {
    font-weight: 700;
    color: #111;
    border-bottom-color: #111;
}
.dm-cc-tab:hover:not(.is-active) { color: #333; }

/* ─── Body ────────────────────────────────────────────────── */
.dm-cc-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dm-cc-panel { display: flex; flex-direction: column; gap: 10px; }
.dm-cc-hidden { display: none !important; }
.dm-cc-empty {
    text-align: center;
    padding: 40px 0;
    color: #6b7a92;
    font-size: 14px;
    margin: 0;
}

/* ─── Category card ───────────────────────────────────────── */
.dm-cc-cat {
    border: 1.5px solid #e3e8ef;
    border-radius: 10px;
    overflow: hidden;
}
.dm-cc-cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    cursor: pointer;
    background: #fff;
    gap: 12px;
    user-select: none;
}
.dm-cc-cat-row:hover { background: #fafafa; }
.dm-cc-cat-info { flex: 1; min-width: 0; }
.dm-cc-cat-name {
    font-weight: 700;
    font-size: 14px;
    color: #111;
    margin-bottom: 4px;
}
.dm-cc-cat-desc {
    font-size: 12px;
    color: #6b7a92;
    line-height: 1.5;
}
.dm-cc-cat-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Toggle switch */
.dm-cc-toggle {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: #e3e8ef;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    border: none;
    padding: 0;
}
.dm-cc-toggle.is-on  { background: #111; }
.dm-cc-toggle.is-required { opacity: 0.5; cursor: default; }
.dm-cc-toggle::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.2s;
}
.dm-cc-toggle.is-on::after { left: 21px; }

/* Chevron */
.dm-cc-chevron {
    flex-shrink: 0;
    color: #aaa;
    transition: transform 0.2s;
    line-height: 0;
}
.dm-cc-chevron.is-open { transform: rotate(180deg); }

/* Expanded detail */
.dm-cc-cat-detail {
    font-size: 12px;
    color: #6b7a92;
    line-height: 1.55;
    padding: 0 18px 14px;
    background: #fafbfc;
}
.dm-cc-cat-detail strong { color: #0A2A5E; margin-inline-start: 6px; }

/* ─── Footer ──────────────────────────────────────────────── */
.dm-cc-footer {
    padding: 18px 24px;
    border-top: 1.5px solid #e3e8ef;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
}
.dm-cc-btn-row {
    display: flex;
    gap: 10px;
}
.dm-cc-btn {
    flex: 1;
    padding: 13px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: #111;
    color: #fff;
    font-family: inherit;
    transition: opacity 0.15s, background 0.15s;
    white-space: nowrap;
}
.dm-cc-btn:hover { background: #333; }
.dm-cc-powered {
    text-align: center;
    font-size: 11px;
    color: #aaa;
    margin: 0;
}

/* ─── Lang switcher popup ─────────────────────────────────── */
#dm-cc-lang-popup {
    position: absolute;
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 9999999;
    min-width: 120px;
}
#dm-cc-lang-popup button {
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-align: start;
    font-family: inherit;
    color: #333;
}
#dm-cc-lang-popup button:hover { background: #f5f5f5; }
#dm-cc-lang-popup button.is-active { font-weight: 700; color: #0A2A5E; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    #dm-cc-modal { border-radius: 12px; }
    .dm-cc-btn-row { flex-direction: column; }
    .dm-cc-btn { width: 100%; }
    .dm-cc-header { padding: 20px 16px 0; }
    .dm-cc-tabs { margin: 12px 16px 0; }
    .dm-cc-body { padding: 14px 16px; }
    .dm-cc-footer { padding: 14px 16px; }
}
