/* ===========================================
   IPPOCRATE PRIVACY & COOKIE MANAGER - BANNER
   Design system minimal/Apple-like
=========================================== */
.ipcm-banner *,
.ipcm-modal * { box-sizing: border-box; }

.ipcm-banner,
.ipcm-modal-overlay {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: #1a1a1a;
}

/* ============ BANNER ============ */
.ipcm-banner {
    position: fixed;
    z-index: 999999;
    background: #ffffff;
    color: #1a1a1a;
    box-shadow: 0 -4px 24px rgba(0,0,0,.12);
    border-radius: 12px;
    padding: 22px 26px;
    max-width: 100%;
    animation: ipcmFadeIn .35s ease-out;
}
.ipcm-banner.ipcm-theme-dark {
    background: #1a1a1a;
    color: #f4f4f4;
    box-shadow: 0 -4px 24px rgba(0,0,0,.5);
}

/* Posizioni */
.ipcm-banner.pos-bottom { bottom: 16px; left: 16px; right: 16px; border-radius: 14px; }
.ipcm-banner.pos-top    { top: 16px;    left: 16px; right: 16px; border-radius: 14px; }
.ipcm-banner.pos-bottom-left  { bottom: 20px; left: 20px; max-width: 440px; }
.ipcm-banner.pos-bottom-right { bottom: 20px; right: 20px; max-width: 440px; }
.ipcm-banner.pos-center {
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    max-width: 540px;
    width: calc(100% - 40px);
}

/* Layout bar (compatto orizzontale) */
.ipcm-banner.layout-bar {
    display: flex; align-items: center; gap: 24px;
    padding: 16px 22px;
}
.ipcm-banner.layout-bar .ipcm-content { flex: 1; }
.ipcm-banner.layout-bar .ipcm-actions { flex-shrink: 0; }

/* Layout box (default) */
.ipcm-banner h3 {
    margin: 0 0 8px 0; font-size: 17px; font-weight: 600;
}
.ipcm-banner p {
    margin: 0 0 14px 0; font-size: 14px;
}
.ipcm-banner a { color: inherit; text-decoration: underline; }
.ipcm-theme-dark.ipcm-banner a { color: #fff; }

.ipcm-actions {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.ipcm-btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: opacity .2s, transform .1s;
    font-family: inherit;
    white-space: nowrap;
}
.ipcm-btn:active { transform: scale(.97); }
.ipcm-btn-primary {
    background: var(--ipcm-accent, #2c5f3f);
    color: var(--ipcm-accent-text, #fff);
}
.ipcm-btn-primary:hover { opacity: .9; }
.ipcm-btn-secondary {
    background: transparent;
    color: inherit;
    border-color: rgba(0,0,0,.18);
}
.ipcm-theme-dark .ipcm-btn-secondary { border-color: rgba(255,255,255,.25); }
.ipcm-btn-secondary:hover { background: rgba(0,0,0,.05); }
.ipcm-theme-dark .ipcm-btn-secondary:hover { background: rgba(255,255,255,.08); }
.ipcm-btn-link {
    background: transparent; border: none; color: inherit;
    text-decoration: underline; padding: 10px 6px;
}

/* ============ MODAL PREFERENZE ============ */
.ipcm-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 999999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: ipcmFadeIn .25s ease-out;
}
.ipcm-modal {
    background: #fff;
    color: #1a1a1a;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    border-radius: 14px;
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 12px 48px rgba(0,0,0,.3);
}
.ipcm-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #ececec;
    display: flex; align-items: center; justify-content: space-between;
}
.ipcm-modal-header h3 { margin: 0; font-size: 18px; font-weight: 600; }
.ipcm-modal-close {
    background: transparent; border: none; font-size: 24px;
    cursor: pointer; line-height: 1; padding: 4px 8px;
    color: #666;
}
.ipcm-modal-body { padding: 20px 24px; overflow-y: auto; }
.ipcm-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #ececec;
    display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
}

/* Switch categoria */
.ipcm-cat {
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.ipcm-cat-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px;
}
.ipcm-cat-name { font-weight: 600; font-size: 15px; }
.ipcm-cat-desc { font-size: 13px; color: #555; margin-top: 6px; }
.ipcm-cat-locked { font-size: 12px; color: #2c5f3f; font-weight: 600; }

/* Switch toggle */
.ipcm-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.ipcm-switch input { opacity: 0; width: 0; height: 0; }
.ipcm-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #ccc; border-radius: 24px; transition: .25s;
}
.ipcm-slider::before {
    position: absolute; content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: white; border-radius: 50%;
    transition: .25s;
}
.ipcm-switch input:checked + .ipcm-slider { background: var(--ipcm-accent, #2c5f3f); }
.ipcm-switch input:checked + .ipcm-slider::before { transform: translateX(20px); }
.ipcm-switch input:disabled + .ipcm-slider { background: var(--ipcm-accent, #2c5f3f); opacity: .55; cursor: not-allowed; }

/* Floating preferences icon (badge) */
.ipcm-floating-pref {
    position: fixed; bottom: 18px; left: 18px;
    width: 42px; height: 42px;
    background: #ffffff;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.12);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    cursor: pointer;
    z-index: 999998;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    transition: transform .2s;
}
.ipcm-floating-pref:hover { transform: scale(1.08); }

/* Pulsante shortcode preferences */
.ipcm-pref-btn {
    background: transparent;
    border: 1px solid currentColor;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}
.ipcm-pref-btn:hover { opacity: .8; }

/* Iframe placeholder (YouTube/Vimeo bloccati) */
[data-ipcm][src="about:blank"] {
    background: #f0f0f0;
    border: 1px dashed #aaa;
    min-height: 200px;
    display: flex; align-items: center; justify-content: center;
}

/* Responsive */
@media (max-width: 640px) {
    .ipcm-banner.layout-bar { flex-direction: column; align-items: stretch; }
    .ipcm-banner h3 { font-size: 16px; }
    .ipcm-actions { flex-direction: column; align-items: stretch; }
    .ipcm-btn { width: 100%; }
    .ipcm-modal-footer { flex-direction: column; }
    .ipcm-modal-footer .ipcm-btn { width: 100%; }
}

@keyframes ipcmFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ipcm-banner.pos-center { animation-name: ipcmFadeInCenter; }
@keyframes ipcmFadeInCenter {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}
