/* ============================================================
   DIG-it AI Logo Modal — FINAL PRODUCTION VERSION
   FLEXBOX-ONLY VERSION (100% Elementor-safe, no grid, no @supports)
============================================================ */

/* ============================
   MODAL WRAPPER
============================ */
#dig-it-logo-modal.dig-it-logo-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;

    display: none !important; 
    justify-content: center !important;
    align-items: center !important;

    z-index: 999999999 !important;
}

#dig-it-logo-modal.active,
#dig-it-logo-modal[aria-hidden="false"] {
    display: flex !important;
}

/* ============================
   OVERLAY
============================ */
.dig-it-logo-modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;

    background: rgba(0,0,0,0.65) !important;
    backdrop-filter: blur(1px) !important;
    z-index: 999999998 !important;
}

/* ============================
   MODAL WINDOW
============================ */
.dig-it-logo-modal-content {
    position: relative !important;
    background: white !important;
    width: 92% !important;
    max-width: 900px !important;
    max-height: 90vh !important;

    overflow-y: auto !important;
    padding: 25px !important;
    border-radius: 12px !important;

    z-index: 999999999 !important;
    box-shadow: 0 8px 40px rgba(0,0,0,0.35) !important;
}

/* ============================
   LOADING OVERLAY
============================ */
.dig-it-logo-loading {
    position: absolute;
    top: 120px;  /* BELOW header + narration */
    left: 0;
    right: 0;
    bottom: 0;

    z-index: 10;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
}

.dig-it-logo-batch-status {
    position: relative;
    z-index: 20;
}

.dig-it-spinner {
    width: 52px;
    height: 52px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: digit-spin 1.1s linear infinite;
}

@keyframes digit-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ============================================================
   LOGO MODAL — NARRATIVE ISOLATION (ANTI-BLUR)
   ============================================================ */

.dig-it-logo-narrative {
    position: relative;
    z-index: 1000000001;

    background: #ffffff;
    padding: 18px 22px;
    margin: 18px 0 24px 0;
    border-radius: 12px;

    /* HARD STOP to blur inheritance */
    backdrop-filter: none !important;
    filter: none !important;
    isolation: isolate;

    box-shadow: 0 6px 18px rgba(0,0,0,0.14);
}

/* Text clarity */
.dig-it-logo-narrative,
.dig-it-logo-narrative * {
    color: #222;
    opacity: 1 !important;
    filter: none !important;
}
.dig-it-logo-narrative {
    font-size: 15px;
    line-height: 1.45;
}

/* ============================================================
   LOADING OVERLAY — KEEP GLASS, KEEP TEXT SHARP
   ============================================================ */

.dig-it-logo-loading {
    isolation: isolate;
}

.dig-it-logo-loading p {
    background: rgba(0,0,0,0.35);
    padding: 12px 18px;
    border-radius: 10px;
    display: inline-block;

    backdrop-filter: none;
    filter: none;
}

.dig-it-logo-modal .logo-text,
.dig-it-logo-modal .logo-narrative {
    position: relative;
    z-index: 20;
}

.dig-it-logo-modal .modal-overlay {
    z-index: 5;
    opacity: 0.35; /* optional */
}


/* ============================
   SELECTED LOGO HIGHLIGHT
============================ */
.dig-it-logo-item.dig-it-logo-selected {
    border: 4px solid #B56EE4 !important;
    border-radius: 10px !important;
    box-shadow: 0 0 18px rgba(181,110,228, 0.8) !important;
    transform: scale(1.05) !important;
    transition: all 0.25s ease !important;
    position: relative !important;
}

.dig-it-logo-item.dig-it-logo-selected::after {
    content: "✔";
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 26px;
    color: #B56EE4;
    font-weight: bold;
    text-shadow: 0px 0px 6px rgba(0,0,0,0.6);
}

/* ============================
   CLOSE BUTTON
============================ */
.dig-it-logo-modal-close {
    position: absolute !important;
    top: 10px !important;
    right: 12px !important;
    font-size: 30px !important;
    border: none !important;
    background: none !important;
    cursor: pointer !important;
    z-index: 999999999 !important;
}

/* ============================================================
   LOGO GRID — FLEXBOX VERSION (5 columns)
   (ZERO lint errors, 100% safe)
============================================================ */
.dig-it-logo-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    gap: 14px !important;
    margin-top: 20px !important;
}

/* 5-per-row layout */
.dig-it-logo-item {
    width: calc(20% - 14px) !important; /* 5 items */
    border: 2px solid #ddd !important;
    background: #fafafa !important;
    padding: 6px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: transform 0.15s ease !important;
}

.dig-it-logo-item:hover {
    transform: scale(1.03);
}

.dig-it-logo-item img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* ============================================================
   RESPONSIVE — FLEX-ONLY (ZERO ERRORS)
============================================================ */
@media (max-width: 768px) {
    .dig-it-logo-item {
        width: calc(33.33% - 14px) !important; /* 3 per row */
    }
}

@media (max-width: 480px) {
    .dig-it-logo-item {
        width: calc(50% - 14px) !important; /* 2 per row */
    }
}
