/* =========================================================
   WP Cookie Consent Pro — Frontend Stylesheet  v2.1.0
   Author: R Darlong
   ========================================================= */

:root {
    --wpcc-primary:       #6C63FF;
    --wpcc-primary-dark:  #574FD6;
    --wpcc-primary-light: #EAE9FF;
    --wpcc-success:       #10B981;
    --wpcc-text:          #1E1B4B;
    --wpcc-text-muted:    #6B7280;
    --wpcc-bg:            #FFFFFF;
    --wpcc-bg-card:       #F9F8FF;
    --wpcc-border:        #E5E7EB;
    --wpcc-radius:        16px;
    --wpcc-radius-sm:     10px;
    --wpcc-shadow:        0 20px 60px rgba(108,99,255,.18), 0 4px 16px rgba(0,0,0,.08);
    --wpcc-shadow-edge:   0 -4px 32px rgba(108,99,255,.14);
    --wpcc-font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --wpcc-transition:    .25s cubic-bezier(.4,0,.2,1);
    --wpcc-z-banner:      99998;
    --wpcc-z-modal:       99999;

    /* Side panel dimensions */
    --wpcc-panel-width:   380px;
}

/* ── Reset ─────────────────────────────────────────── */
#wpcc-banner *, #wpcc-modal * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =========================================================
   BANNER — shared base
   ========================================================= */
.wpcc-banner {
    position: fixed;
    z-index: var(--wpcc-z-banner);
    display: none;
    background: var(--wpcc-bg);
}

/* =========================================================
   POSITION VARIANTS
   ========================================================= */

/* ── Bottom (default) ──────────────────────────────── */
.wpcc-banner--bottom {
    bottom: 0; left: 0; right: 0;
    border-top: 3px solid var(--wpcc-primary);
    box-shadow: var(--wpcc-shadow-edge);
    animation: wpccSlideUp .4s cubic-bezier(.34,1.28,.64,1) both;
}

@keyframes wpccSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Top ───────────────────────────────────────────── */
.wpcc-banner--top {
    top: 0; left: 0; right: 0;
    border-bottom: 3px solid var(--wpcc-primary);
    box-shadow: 0 4px 32px rgba(108,99,255,.14);
    animation: wpccSlideDown .4s cubic-bezier(.34,1.28,.64,1) both;
}

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

/* ── Left Bottom panel ─────────────────────────────── */
.wpcc-banner--bottom-left {
    bottom: 0; left: 0;
    width: 500px;
    height: 250px;
    border-top: 3px solid var(--wpcc-primary);
    border-right: 3px solid var(--wpcc-primary);
    border-radius: 0 var(--wpcc-radius) 0 0;
    box-shadow: 4px -4px 32px rgba(108,99,255,.18);
    animation: wpccSlideUpLeft .4s cubic-bezier(.34,1.28,.64,1) both;
    overflow-y: auto;
}

@keyframes wpccSlideUpLeft {
    from { transform: translate(-30%, 100%); opacity: 0; }
    to   { transform: translate(0, 0);       opacity: 1; }
}

/* ── Right Bottom panel ────────────────────────────── */
.wpcc-banner--bottom-right {
    bottom: 0; right: 0;
    width: 500px;
    height: 250px;
    border-top: 3px solid var(--wpcc-primary);
    border-left: 3px solid var(--wpcc-primary);
    border-radius: var(--wpcc-radius) 0 0 0;
    box-shadow: -4px -4px 32px rgba(108,99,255,.18);
    animation: wpccSlideUpRight .4s cubic-bezier(.34,1.28,.64,1) both;
    overflow-y: auto;
}

@keyframes wpccSlideUpRight {
    from { transform: translate(30%, 100%); opacity: 0; }
    to   { transform: translate(0, 0);      opacity: 1; }
}

/* =========================================================
   BANNER INNER — layout adapts per position
   ========================================================= */
.wpcc-banner-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 36px;   /* taller than before */
    flex-wrap: wrap;
}

/* Bottom corner panels — compact horizontal layout */
.wpcc-banner--bottom-left  .wpcc-banner-inner,
.wpcc-banner--bottom-right .wpcc-banner-inner {
    flex-direction: row;
    align-items: center;
    max-width: none;
    padding: 16px 20px;
    height: 100%;
    gap: 14px;
    flex-wrap: nowrap;
    overflow: hidden;
}

/* Bottom corner panels — icon compact */
.wpcc-banner--bottom-left  .wpcc-banner-icon,
.wpcc-banner--bottom-right .wpcc-banner-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

/* Bottom corner panels — text fills available space */
.wpcc-banner--bottom-left  .wpcc-banner-text,
.wpcc-banner--bottom-right .wpcc-banner-text {
    flex: 1;
    min-width: 0;
    width: auto;
}

.wpcc-banner--bottom-left  .wpcc-banner-title,
.wpcc-banner--bottom-right .wpcc-banner-title {
    font-size: 14px !important;
    text-align: left;
}

.wpcc-banner--bottom-left  .wpcc-banner-desc,
.wpcc-banner--bottom-right .wpcc-banner-desc {
    font-size: 12px;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Bottom corner panels — buttons stacked vertically on the right */
.wpcc-banner--bottom-left  .wpcc-banner-actions,
.wpcc-banner--bottom-right .wpcc-banner-actions {
    flex-direction: column;
    flex-shrink: 0;
    width: 130px;
    gap: 6px;
    align-items: stretch;
}

.wpcc-banner--bottom-left  .wpcc-banner-actions .wpcc-btn,
.wpcc-banner--bottom-right .wpcc-banner-actions .wpcc-btn {
    width: 100%;
    justify-content: center;
    padding: 9px 12px;
    font-size: 12px;
}

/* ── Icon ──────────────────────────────────────────── */
.wpcc-banner-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: var(--wpcc-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wpcc-primary);
}

.wpcc-banner-icon svg { width: 30px; height: 30px; }

/* ── Text ──────────────────────────────────────────── */
.wpcc-banner-text { flex: 1; min-width: 220px; }

.wpcc-banner-title {
    font-family: var(--wpcc-font);
    font-size: 17px;
    font-weight: 700;
    color: var(--wpcc-text);
    margin-bottom: 6px;
    line-height: 1.3;
}

.wpcc-banner-desc {
    font-family: var(--wpcc-font);
    font-size: 14px;
    color: var(--wpcc-text-muted);
    line-height: 1.6;
}

.wpcc-link {
    color: var(--wpcc-primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    transition: color var(--wpcc-transition);
}

.wpcc-link:hover { color: var(--wpcc-primary-dark); text-decoration: underline; }

/* ── Actions ───────────────────────────────────────── */
.wpcc-banner-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.wpcc-btn {
    font-family: var(--wpcc-font);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    border: 2px solid transparent;
    border-radius: var(--wpcc-radius-sm);
    cursor: pointer;
    padding: 11px 22px;
    transition: all var(--wpcc-transition);
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wpcc-btn:focus-visible { outline: 3px solid var(--wpcc-primary); outline-offset: 3px; }

.wpcc-btn-primary { background: var(--wpcc-primary); color: #fff; border-color: var(--wpcc-primary); }
.wpcc-btn-primary:hover { background: var(--wpcc-primary-dark); border-color: var(--wpcc-primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(108,99,255,.35); }
.wpcc-btn-primary:active { transform: translateY(0); }

.wpcc-btn-secondary { background: var(--wpcc-bg); color: var(--wpcc-primary); border-color: var(--wpcc-primary); }
.wpcc-btn-secondary:hover { background: var(--wpcc-primary-light); transform: translateY(-1px); }

.wpcc-btn-outline { background: transparent; color: var(--wpcc-text-muted); border-color: var(--wpcc-border); }
.wpcc-btn-outline:hover { background: var(--wpcc-bg-card); border-color: var(--wpcc-text-muted); color: var(--wpcc-text); }

.wpcc-btn-ghost { background: transparent; color: var(--wpcc-text-muted); border-color: transparent; font-size: 13px; }
.wpcc-btn-ghost:hover { color: var(--wpcc-text); background: var(--wpcc-bg-card); }

/* Reopen shortcode button */
.wpcc-reopen-btn {
    font-family: var(--wpcc-font);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--wpcc-radius-sm);
    background: var(--wpcc-primary-light);
    color: var(--wpcc-primary);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--wpcc-transition);
}
.wpcc-reopen-btn:hover { background: var(--wpcc-primary); color: #fff; transform: translateY(-1px); }
.wpcc-reopen-btn:focus-visible { outline: 3px solid var(--wpcc-primary); outline-offset: 3px; }

/* =========================================================
   MODAL OVERLAY
   ========================================================= */
.wpcc-modal {
    position: fixed;
    inset: 0;
    z-index: var(--wpcc-z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.wpcc-modal.is-open { display: flex; animation: wpccFadeIn .2s ease both; }

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

.wpcc-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15,12,41,.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* =========================================================
   MODAL CARD
   ========================================================= */
.wpcc-modal-content {
    position: relative;
    z-index: 1;
    background: var(--wpcc-bg);
    border-radius: var(--wpcc-radius);
    box-shadow: var(--wpcc-shadow);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: wpccScaleIn .3s cubic-bezier(.34,1.28,.64,1) both;
}

@keyframes wpccScaleIn {
    from { transform: scale(.92) translateY(12px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

.wpcc-modal-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--wpcc-border);
    background: linear-gradient(135deg, var(--wpcc-primary-light) 0%, #fff 60%);
    flex-shrink: 0;
}

.wpcc-modal-header-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    background: var(--wpcc-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wpcc-primary);
    border: 2px solid rgba(108,99,255,.2);
}

.wpcc-modal-header-icon svg { width: 24px; height: 24px; }

.wpcc-modal-title { font-family: var(--wpcc-font); font-size: 18px; font-weight: 800; color: var(--wpcc-text); line-height: 1.25; }
.wpcc-modal-subtitle { font-family: var(--wpcc-font); font-size: 13px; color: var(--wpcc-text-muted); margin-top: 3px; line-height: 1.4; }

.wpcc-modal-close {
    margin-left: auto;
    flex-shrink: 0;
    width: 34px; height: 34px;
    border: none;
    background: var(--wpcc-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wpcc-text-muted);
    transition: all var(--wpcc-transition);
    align-self: flex-start;
}

.wpcc-modal-close svg { width: 16px; height: 16px; }
.wpcc-modal-close:hover { background: var(--wpcc-border); color: var(--wpcc-text); transform: rotate(90deg); }
.wpcc-modal-close:focus-visible { outline: 3px solid var(--wpcc-primary); outline-offset: 2px; }

.wpcc-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--wpcc-border) transparent;
}

.wpcc-modal-body::-webkit-scrollbar { width: 5px; }
.wpcc-modal-body::-webkit-scrollbar-track { background: transparent; }
.wpcc-modal-body::-webkit-scrollbar-thumb { background: var(--wpcc-border); border-radius: 99px; }

/* ── Cookie Categories ─────────────────────────────── */
.wpcc-category {
    border: 1.5px solid var(--wpcc-border);
    border-radius: var(--wpcc-radius-sm);
    margin-bottom: 12px;
    background: var(--wpcc-bg);
    transition: border-color var(--wpcc-transition), box-shadow var(--wpcc-transition);
    overflow: hidden;
}

.wpcc-category:hover { border-color: rgba(108,99,255,.3); box-shadow: 0 2px 12px rgba(108,99,255,.08); }
.wpcc-category:last-child { margin-bottom: 0; }

.wpcc-category-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; }

.wpcc-category-info { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }

.wpcc-category-icon {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.wpcc-category-icon svg { width: 17px; height: 17px; }

.wpcc-icon-necessary   { background: #FFF3E0; color: #F57C00; }
.wpcc-icon-analytics   { background: #E3F2FD; color: #1565C0; }
.wpcc-icon-marketing   { background: #FCE4EC; color: #C62828; }
.wpcc-icon-preferences { background: #E8F5E9; color: #2E7D32; }

.wpcc-category-title { font-family: var(--wpcc-font); font-size: 14px; font-weight: 700; color: var(--wpcc-text); margin-bottom: 4px; line-height: 1.3; }
.wpcc-category-desc  { font-family: var(--wpcc-font); font-size: 12.5px; color: var(--wpcc-text-muted); line-height: 1.5; }

.wpcc-toggle-wrap { flex-shrink: 0; }

.wpcc-always-on { font-family: var(--wpcc-font); font-size: 11px; font-weight: 700; color: var(--wpcc-success); background: #D1FAE5; padding: 4px 10px; border-radius: 99px; letter-spacing: .3px; white-space: nowrap; }

/* Toggle */
.wpcc-toggle { position: relative; display: inline-block; width: 46px; height: 26px; cursor: pointer; }
.wpcc-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.wpcc-slider { position: absolute; inset: 0; background: var(--wpcc-border); border-radius: 99px; transition: background var(--wpcc-transition); }
.wpcc-slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform var(--wpcc-transition); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.wpcc-toggle input:checked + .wpcc-slider { background: var(--wpcc-primary); }
.wpcc-toggle input:checked + .wpcc-slider::before { transform: translateX(20px); }
.wpcc-toggle input:focus-visible + .wpcc-slider { outline: 3px solid var(--wpcc-primary); outline-offset: 2px; }

/* Footer */
.wpcc-modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--wpcc-border); background: var(--wpcc-bg-card); flex-shrink: 0; flex-wrap: wrap; }
.wpcc-modal-footer-right { display: flex; gap: 10px; flex-wrap: wrap; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
    .wpcc-banner-inner { padding: 20px 20px; gap: 14px; }
    .wpcc-banner-actions { width: 100%; justify-content: flex-end; }

    /* Bottom corner panels become full-width bottom sheet on mobile */
    .wpcc-banner--bottom-left,
    .wpcc-banner--bottom-right {
        width: 100%; height: auto;
        left: 0; right: 0; bottom: 0;
        border-left: none; border-right: none;
        border-radius: 0;
        animation: wpccSlideUp .4s cubic-bezier(.34,1.28,.64,1) both;
    }

    .wpcc-banner--bottom-left  .wpcc-banner-inner,
    .wpcc-banner--bottom-right .wpcc-banner-inner {
        flex-wrap: wrap;
        padding: 20px 20px;
        height: auto;
        gap: 14px;
    }

    .wpcc-banner--bottom-left  .wpcc-banner-title,
    .wpcc-banner--bottom-right .wpcc-banner-title { text-align: left; }
    .wpcc-banner--bottom-left  .wpcc-banner-desc,
    .wpcc-banner--bottom-right .wpcc-banner-desc  { text-align: left; -webkit-line-clamp: unset; }
    .wpcc-banner--bottom-left  .wpcc-banner-actions,
    .wpcc-banner--bottom-right .wpcc-banner-actions { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 10px; }
}

@media (max-width: 480px) {
    .wpcc-banner-inner { padding: 16px 16px; flex-direction: column; align-items: flex-start; gap: 12px; }
    .wpcc-banner-icon  { display: none; }
    .wpcc-banner-title { font-size: 15px; }
    .wpcc-banner-desc  { font-size: 12.5px; }
    .wpcc-banner-actions { width: 100%; flex-direction: column; gap: 8px; }
    .wpcc-btn { width: 100%; justify-content: center; padding: 13px 16px; font-size: 14px; }

    .wpcc-modal { padding: 0; align-items: flex-end; }
    .wpcc-modal-content { max-width: 100%; border-radius: var(--wpcc-radius) var(--wpcc-radius) 0 0; max-height: 92vh; animation: wpccSlideUpModal .3s cubic-bezier(.34,1.1,.64,1) both; }
    @keyframes wpccSlideUpModal { from { transform: translateY(100%); } to { transform: translateY(0); } }
    .wpcc-modal-header { padding: 18px 16px 14px; }
    .wpcc-modal-body   { padding: 12px 16px; }
    .wpcc-modal-footer { padding: 12px 16px; flex-direction: column; gap: 8px; }
    .wpcc-modal-footer .wpcc-btn-ghost { order: 3; width: 100%; }
    .wpcc-modal-footer-right { width: 100%; flex-direction: column; }
    .wpcc-modal-footer-right .wpcc-btn { width: 100%; }
}

/* ── Dark mode ─────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    :root {
        --wpcc-bg:            #1A1A2E;
        --wpcc-bg-card:       #16213E;
        --wpcc-text:          #F1F0FF;
        --wpcc-text-muted:    #A0A8C0;
        --wpcc-border:        #2E2E4E;
        --wpcc-primary-light: rgba(108,99,255,.18);
    }
    .wpcc-modal-header { background: linear-gradient(135deg, rgba(108,99,255,.12) 0%, var(--wpcc-bg) 60%); }
    .wpcc-modal-close  { background: rgba(255,255,255,.06); }
    .wpcc-modal-close:hover { background: rgba(255,255,255,.12); }
    .wpcc-icon-necessary   { background: rgba(245,124,0,.18);  color: #FFB74D; }
    .wpcc-icon-analytics   { background: rgba(21,101,192,.2);  color: #90CAF9; }
    .wpcc-icon-marketing   { background: rgba(198,40,40,.18);  color: #EF9A9A; }
    .wpcc-icon-preferences { background: rgba(46,125,50,.18);  color: #A5D6A7; }
    .wpcc-always-on        { background: rgba(16,185,129,.18); color: #6EE7B7; }
    .wpcc-slider           { background: #2E2E4E; }
    .wpcc-btn-secondary    { background: transparent; }
    .wpcc-btn-outline      { border-color: var(--wpcc-border); }
    .wpcc-btn-outline:hover { background: rgba(255,255,255,.06); }
}

/* ── Reduced motion ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .wpcc-banner, .wpcc-modal, .wpcc-modal-content, .wpcc-btn, .wpcc-slider, .wpcc-modal-close, .wpcc-category { transition: none; animation: none; }
}
