/* ============================================================
   QB — Logos Marquee Slider  v1.0  |  qb-logos.css
   Almasa Digital — QB Studio
   Design system: deep navy #080E2E · purple #5F2DEE
   Accent teal: #6EC1E4 · text rgba(255,255,255,x)
   ============================================================ */

/* ── Custom Properties ────────────────────────────────────── */
.qbl-section {
    --qbl-navy:       #080E2E;
    --qbl-navy-deep:  #04091B;
    --qbl-purple:     #5F2DEE;
    --qbl-teal:       #6EC1E4;
    --qbl-white:      #FFFFFF;
    --qbl-glow:       #6EC1E4;       /* overridden per-card */
    --qbl-div-color:  rgba(110,193,228,0.15);

    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 90px 0;
    box-sizing: border-box;
}

/* ── Backgrounds ──────────────────────────────────────────── */
.qbl-bg-dark        { background-color: #080E2E; }
.qbl-bg-darker      { background-color: #04091B; }
.qbl-bg-transparent { background-color: transparent; }
.qbl-bg-custom      { /* color set via Elementor selectors */ }

/* ── Particle Canvas ──────────────────────────────────────── */
.qbl-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    opacity: 0.55;
}

/* ── Dividers ─────────────────────────────────────────────── */
.qbl-has-dividers::before,
.qbl-has-dividers::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 1px;
    background: var(--qbl-div-color, rgba(110,193,228,0.15));
    z-index: 1;
}
.qbl-has-dividers::before { top: 0; }
.qbl-has-dividers::after  { bottom: 0; }

/* ── Header ───────────────────────────────────────────────── */
.qbl-header {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 24px 56px;
    max-width: 720px;
    margin: 0 auto;
}

.qbl-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: clamp(0.6rem, 1.2vw, 0.78rem);
    font-weight: 700;
    letter-spacing: 0.36em;
    text-transform: uppercase;
    color: #6EC1E4;
    margin: 0 0 18px;
    opacity: 0;
    transform: translateY(20px);
    animation: qbl-fadein 0.8s cubic-bezier(.16,1,.3,1) 0.1s forwards;
}

.qbl-eye-line {
    display: block;
    width: 32px;
    height: 1px;
    background: currentColor;
    opacity: 0.4;
}

.qbl-title {
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin: 0 0 16px;
    opacity: 0;
    transform: translateY(24px);
    animation: qbl-fadein 0.9s cubic-bezier(.16,1,.3,1) 0.2s forwards;
}

.qbl-subtitle {
    font-size: clamp(0.88rem, 1.6vw, 1.05rem);
    color: rgba(255,255,255,0.52);
    line-height: 1.75;
    margin: 0;
    opacity: 0;
    transform: translateY(18px);
    animation: qbl-fadein 0.9s cubic-bezier(.16,1,.3,1) 0.32s forwards;
}

@keyframes qbl-fadein {
    to { opacity: 1; transform: translateY(0); }
}

/* ── Rows Container ───────────────────────────────────────── */
.qbl-rows {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Track Wrapper ────────────────────────────────────────── */
.qbl-track-wrap {
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Edge Fades — set via JS as CSS vars on the wrap */
.qbl-track-wrap.qbl-masked {
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 var(--qbl-mask-w, 140px),
        #000 calc(100% - var(--qbl-mask-w, 140px)),
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 var(--qbl-mask-w, 140px),
        #000 calc(100% - var(--qbl-mask-w, 140px)),
        transparent 100%
    );
}

/* ── Track (the moving strip) ─────────────────────────────── */
.qbl-track {
    display: flex;
    align-items: center;
    will-change: transform;
    /* width set by JS to hold all cloned cards */
}

/* Paused state */
.qbl-track.qbl-paused {
    animation-play-state: paused !important;
}

/* ── Logo Card ────────────────────────────────────────────── */
.qbl-card {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(110,193,228,0.18);
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    text-decoration: none;
    cursor: default;
    transition:
        transform 0.32s cubic-bezier(.34,1.56,.64,1),
        border-color 0.32s ease,
        box-shadow 0.32s ease,
        background 0.32s ease;

    /* shimmer layer */
    --shimmer-x: 50%;
    --shimmer-y: 50%;
}

a.qbl-card { cursor: pointer; }

/* ── Card Glow Ring (orbital) ─────────────────────────────── */
.qbl-card-ring {
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    border: 1px solid var(--qbl-glow, #6EC1E4);
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    z-index: 2;
    /* animated dash */
    background: transparent;
}

/* ── Crystalline Shimmer ──────────────────────────────────── */
.qbl-card-shimmer {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        circle 80px at var(--shimmer-x) var(--shimmer-y),
        rgba(255,255,255,0.12) 0%,
        rgba(110,193,228,0.06) 40%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

/* ── Logo Image ───────────────────────────────────────────── */
.qbl-logo-img {
    display: block;
    max-width: 100%;
    height: 100%;
    width: auto;
    object-fit: contain;
    position: relative;
    z-index: 3;
    transition:
        opacity 0.3s ease,
        filter 0.3s ease,
        transform 0.32s ease;
}

/* Filters */
.qbl-filter-grayscale .qbl-logo-img { filter: grayscale(100%); }
.qbl-filter-white     .qbl-logo-img { filter: brightness(0) invert(1); }
.qbl-filter-invert    .qbl-logo-img { filter: invert(1); }
.qbl-filter-none      .qbl-logo-img { filter: none; }

/* ── Logo Text Fallback (no image) ───────────────────────── */
.qbl-logo-text {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.65);
    position: relative;
    z-index: 3;
    transition: color 0.3s ease;
}

/* ── Logo Name (optional) ─────────────────────────────────── */
.qbl-logo-name {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-top: 10px;
    position: relative;
    z-index: 3;
    transition: color 0.3s ease;
}

/* ── HOVER STATE ─────────────────────────────────────────── */
.qbl-card:hover {
    border-color: var(--qbl-glow, #6EC1E4);
    background: rgba(255,255,255,0.08);
    box-shadow:
        0 0 24px color-mix(in srgb, var(--qbl-glow, #6EC1E4) 28%, transparent),
        0 0 60px color-mix(in srgb, var(--qbl-glow, #6EC1E4) 10%, transparent),
        inset 0 0 18px color-mix(in srgb, var(--qbl-glow, #6EC1E4) 6%, transparent);
}

/* Fallback for browsers without color-mix */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .qbl-card:hover {
        box-shadow:
            0 0 24px rgba(110,193,228,0.28),
            0 0 60px rgba(110,193,228,0.10),
            inset 0 0 18px rgba(110,193,228,0.06);
    }
}

.qbl-card:hover .qbl-card-ring {
    opacity: 0.55;
    transform: scale(1.0);
}

.qbl-card:hover .qbl-card-shimmer {
    opacity: 1;
}

.qbl-card:hover .qbl-logo-img {
    opacity: 1 !important;
    filter: none !important;
    transform: scale(1.06);
}

.qbl-card:hover .qbl-logo-text {
    color: var(--qbl-glow, #6EC1E4);
}

.qbl-card:hover .qbl-logo-name {
    color: rgba(255,255,255,0.7);
}

/* ── Spinning ring on hover (orbital effect) ─────────────── */
.qbl-card::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: calc(16px + 6px);
    border: 1px dashed transparent;
    border-top-color: var(--qbl-glow, #6EC1E4);
    border-right-color: var(--qbl-glow, #6EC1E4);
    opacity: 0;
    transform: rotate(0deg);
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 0;
}
.qbl-card:hover::before {
    opacity: 0.3;
    animation: qbl-spin 3s linear infinite;
}

@keyframes qbl-spin {
    to { transform: rotate(360deg); }
}

/* ── Bottom diamond accent ────────────────────────────────── */
.qbl-card::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 5px; height: 5px;
    background: var(--qbl-glow, #6EC1E4);
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
    z-index: 3;
}
.qbl-card:hover::after {
    opacity: 0.6;
}

/* ── Ambient glow pulse on section ───────────────────────── */
.qbl-section::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(110,193,228,0.35) 30%,
        rgba(95,45,238,0.35) 70%,
        transparent
    );
    z-index: 1;
    animation: qbl-hline 6s ease-in-out infinite alternate;
}
@keyframes qbl-hline {
    0%   { opacity: 0.4; width: 40%; }
    100% { opacity: 1;   width: 75%; }
}

/* ── Reduced Motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .qbl-eyebrow,
    .qbl-title,
    .qbl-subtitle {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .qbl-card:hover::before { animation: none !important; }
    .qbl-section::after      { animation: none !important; }
    .qbl-track { transition: none !important; }
}

/* ── RTL ──────────────────────────────────────────────────── */
[dir="rtl"] .qbl-header  { direction: rtl; }
[dir="rtl"] .qbl-eyebrow { flex-direction: row-reverse; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .qbl-section { padding: 60px 0; }
    .qbl-header  { padding-bottom: 36px; }
}

/* ── Elementor Editor: show static state ─────────────────── */
.elementor-editor-active .qbl-eyebrow,
.elementor-editor-active .qbl-title,
.elementor-editor-active .qbl-subtitle {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

/* ============================================================
   LIGHT MODE  — added v1.1
   Activated via .qbl-light class on .qbl-section
   ============================================================ */

.qbl-section.qbl-light {
    --qbl-glow:      #5F2DEE;
    --qbl-div-color: rgba(95,45,238,0.12);
    background-color: #F7F7F5;
}

/* Soft ambient radial — replaces the dark starfield feel */
.qbl-section.qbl-light::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 15% 50%, rgba(110,193,228,0.08) 0%, transparent 65%),
        radial-gradient(ellipse 60% 55% at 85% 50%, rgba(95,45,238,0.07) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

/* Override the bottom ambient line */
.qbl-section.qbl-light::after {
    background: linear-gradient(90deg,
        transparent,
        rgba(95,45,238,0.22) 30%,
        rgba(110,193,228,0.22) 70%,
        transparent
    );
}

/* Dividers */
.qbl-section.qbl-light.qbl-has-dividers::before,
.qbl-section.qbl-light.qbl-has-dividers::after {
    background: rgba(95,45,238,0.12);
}

/* Header text */
.qbl-section.qbl-light .qbl-eyebrow  { color: #5F2DEE; }
.qbl-section.qbl-light .qbl-title    { color: #080E2E; }
.qbl-section.qbl-light .qbl-subtitle { color: rgba(8,14,46,0.55); }
.qbl-section.qbl-light .qbl-eye-line { background: #5F2DEE; opacity: 0.35; }

/* Cards */
.qbl-section.qbl-light .qbl-card {
    background:    rgba(255,255,255,0.85);
    border-color:  rgba(95,45,238,0.14);
    box-shadow:    0 2px 16px rgba(8,14,46,0.06);
    backdrop-filter: blur(8px);
}

.qbl-section.qbl-light .qbl-card:hover {
    background:    rgba(255,255,255,0.98);
    border-color:  var(--qbl-glow, #5F2DEE);
    box-shadow:
        0 0 24px color-mix(in srgb, var(--qbl-glow,#5F2DEE) 18%, transparent),
        0 4px 32px rgba(8,14,46,0.10);
}

/* Fallback for no color-mix */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .qbl-section.qbl-light .qbl-card:hover {
        box-shadow:
            0 0 24px rgba(95,45,238,0.18),
            0 4px 32px rgba(8,14,46,0.10);
    }
}

/* Logo filter: keep original colors in light mode by default,
   but still respect the Elementor filter control */
.qbl-section.qbl-light.qbl-filter-white .qbl-logo-img {
    /* Invert the white filter: show dark logos on light bg */
    filter: brightness(0);
}

/* Light mode logos: full opacity on hover (same as dark) */
.qbl-section.qbl-light .qbl-card:hover .qbl-logo-img {
    opacity: 1 !important;
    filter: none !important;
}

/* Text fallback */
.qbl-section.qbl-light .qbl-logo-text {
    color: rgba(8,14,46,0.6);
}
.qbl-section.qbl-light .qbl-logo-name {
    color: rgba(8,14,46,0.4);
}
.qbl-section.qbl-light .qbl-card:hover .qbl-logo-text { color: #5F2DEE; }

/* Orbital ring */
.qbl-section.qbl-light .qbl-card-ring {
    border-color: #5F2DEE;
}

/* Particles invisible in light mode — too noisy */
.qbl-section.qbl-light .qbl-particles { opacity: 0.18; }

/* Shimmer adjusted */
.qbl-section.qbl-light .qbl-card-shimmer {
    background: radial-gradient(
        circle 80px at var(--shimmer-x) var(--shimmer-y),
        rgba(95,45,238,0.08) 0%,
        rgba(110,193,228,0.04) 40%,
        transparent 70%
    );
}

/* Edge mask: fade to light bg color */
.qbl-section.qbl-light .qbl-track-wrap.qbl-masked {
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 var(--qbl-mask-w, 140px),
        #000 calc(100% - var(--qbl-mask-w, 140px)),
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 var(--qbl-mask-w, 140px),
        #000 calc(100% - var(--qbl-mask-w, 140px)),
        transparent 100%
    );
}

/* ── Light bg class ──────────────────────────────────────── */
.qbl-bg-light { background-color: #F7F7F5; }

/* Fix: dividers ::before/::after conflict with light ambient ::before
   in light mode, use box-shadow lines instead */
.qbl-section.qbl-light.qbl-has-dividers::before {
    background: var(--qbl-div-color, rgba(95,45,238,0.12));
    /* reset the ambient radial we added for light mode */
    background: var(--qbl-div-color, rgba(95,45,238,0.12));
}
