/* ============================================================
   SPONSORS FLOATING LAYERS — sponsors-floating.css
   Modular, scoped under .sf-section. No globals touched.
   ============================================================ */

/* ---- CSS Custom property for animated border ------------- */

@property --sf-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

/* ---- Float keyframes (random directions) ------------------ */

/* Up-down */
@keyframes sfFloat1 {
    0%, 100% { transform: translate(0px,   0px); }
    50%       { transform: translate(0px,  -6px); }
}

/* Up + slight right */
@keyframes sfFloat2 {
    0%, 100% { transform: translate(0px,   0px); }
    50%       { transform: translate(3px,  -5px); }
}

/* Gentle figure-8 path */
@keyframes sfFloat3 {
    0%   { transform: translate( 0px,   0px); }
    25%  { transform: translate(-3px,  -4px); }
    50%  { transform: translate( 1px,  -7px); }
    75%  { transform: translate( 3px,  -3px); }
    100% { transform: translate( 0px,   0px); }
}

/* Up + slight left, uneven */
@keyframes sfFloat4 {
    0%   { transform: translate( 0px,   0px); }
    40%  { transform: translate(-3px,  -4px); }
    80%  { transform: translate(-1px,  -6px); }
    100% { transform: translate( 0px,   0px); }
}

/* Diagonal up-left */
@keyframes sfFloat5 {
    0%, 100% { transform: translate( 0px,   0px); }
    50%       { transform: translate(-2px,  -5px); }
}

/* Slight right drift, low amplitude */
@keyframes sfFloat6 {
    0%, 100% { transform: translate( 0px,  0px); }
    60%       { transform: translate( 2px, -3px); }
}

/* Energy grid pulse */
@keyframes sfGridPulse {
    0%, 100% { opacity: 0.10; }
    50%       { opacity: 0.15; }
}

/* Single-pass border trace */
@keyframes sfBorderTrace {
    from { --sf-angle: 0deg; }
    to   { --sf-angle: 360deg; }
}

/* ---- Section wrapper ------------------------------------- */

.sf-section {
    position: relative;
    background: #07090f;
    padding: 64px 0 72px;
    overflow: hidden;
    isolation: isolate;
}

/* Energy grid — very subtle */
.sf-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M 60 0 L 0 0 0 60' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    opacity: 0.10;
    animation: sfGridPulse 11s ease-in-out infinite;
    animation-play-state: paused;
    pointer-events: none;
    z-index: 0;
}

.sf-section.sf-is-visible::before {
    animation-play-state: running;
}

/* ---- Inner container ------------------------------------- */

.sf-inner {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 52px;
}

/* ---- Tier label ----------------------------------------- */

.sf-tier-label {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 20px;
}

/* ---- CTA button ----------------------------------------- */

.sf-cta-wrap {
    display: flex;
    justify-content: center;
    padding-top: 12px;
}

.sf-cta-btn {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-light);
    padding: 24px 64px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
    text-decoration: none;
    text-transform: uppercase;
    transition: var(--transition);
    border: 2px solid var(--color-primary);
}

.sf-cta-btn:hover {
    background: transparent;
    color: var(--color-light);
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(255, 69, 0, 0.5);
}

/* ---- Float wrappers (carry float animation) -------------- */
/*
   Float wrappers are siblings in the grid/flex layout.
   The card inside carries rotation and hover — no transform conflict.
*/

.sf-float-wrap {
    animation-play-state: paused;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-fill-mode: none;
}

.sf-section.sf-is-visible .sf-float-wrap {
    animation-play-state: running;
}

/* Partner floats — distinct paths and durations */
.sf-float-wrap--1 { animation-name: sfFloat3; animation-duration: 4.4s; animation-delay:  0.0s; }
.sf-float-wrap--2 { animation-name: sfFloat2; animation-duration: 5.2s; animation-delay:  1.7s; }

/* Sponsor floats */
.sf-float-wrap-sp--1 { animation-name: sfFloat1; animation-duration: 3.9s; animation-delay: 0.3s; }
.sf-float-wrap-sp--2 { animation-name: sfFloat4; animation-duration: 4.8s; animation-delay: 1.1s; }
.sf-float-wrap-sp--3 { animation-name: sfFloat5; animation-duration: 5.3s; animation-delay: 0.6s; }
.sf-float-wrap-sp--4 { animation-name: sfFloat6; animation-duration: 4.2s; animation-delay: 2.2s; }
.sf-float-wrap-sp--5 { animation-name: sfFloat2; animation-duration: 4.5s; animation-delay: 1.5s; }

/* ---- Shared card inner ---------------------------------- */

.sf-card-inner {
    border-radius: 18px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.055) 0%,
        rgba(255, 255, 255, 0.018) 100%
    );
}

/* ---- Matte logo stage ----------------------------------- */

.sf-logo-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin: 12px 12px 0;
    padding: 16px 20px;
    /* Alb în centru, gradient discret spre margini (vignette ~16px) */
    background:
        linear-gradient(to right,  rgba(200, 208, 225, 0.45) 0px, transparent 16px),
        linear-gradient(to left,   rgba(200, 208, 225, 0.45) 0px, transparent 16px),
        linear-gradient(to bottom, rgba(200, 208, 225, 0.45) 0px, transparent 16px),
        linear-gradient(to top,    rgba(200, 208, 225, 0.45) 0px, transparent 16px),
        #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(0, 0, 0, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.16);
}

.sf-logo-stage img {
    display: block;
    width: 90%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    filter: none;
}

.sf-card-bottom-pad {
    height: 14px;
}

/* ---- Layer 1: Partners ---------------------------------- */

.sf-partners {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 36px; /* spațiu clar, fără suprapunere */
}

.sf-partner-card {
    position: relative;
    width: 340px;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    border: 1px solid rgba(255, 106, 0, 0.22);
    padding: 2px;
    cursor: default;
    box-shadow:
        0  4px 18px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    /* Slow-motion hover transition */
    transition:
        transform 0.70s cubic-bezier(0.25, 1, 0.50, 1),
        box-shadow 0.70s ease,
        border-color 0.70s ease;
}

/* Thin orange inner-edge accent */
.sf-partner-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    box-shadow: inset 0 0 0 1px rgba(255, 106, 0, 0.18);
    pointer-events: none;
    z-index: 2;
    transition: box-shadow 0.70s ease;
}

.sf-partner-card:hover::before {
    box-shadow: inset 0 0 0 1px rgba(255, 106, 0, 0.40);
}

/* No rotation */
.sf-partner-card--1 {
    z-index: 2;
}

.sf-partner-card--2 {
    z-index: 1;
}

/* Hover: slow-motion lift + slight scale */
.sf-partner-card--1:hover {
    transform: scale(1.03) translateY(-6px);
    z-index: 3;
}

.sf-partner-card--2:hover {
    transform: scale(1.03) translateY(-6px);
    z-index: 3;
}

.sf-partner-card:hover {
    border-color: rgba(255, 106, 0, 0.36);
    box-shadow:
        0  10px 30px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Animated border trace — single pass on hover */
.sf-partner-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 21px;
    background: conic-gradient(
        from var(--sf-angle),
        transparent 0deg,
        rgba(255, 106, 0, 0.85) 50deg,
        rgba(255, 179, 71, 0.70) 100deg,
        transparent 140deg,
        transparent 360deg
    );
    opacity: 0;
    transition: opacity 0.30s ease;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    padding: 1px;
    z-index: 5;
    pointer-events: none;
}

.sf-partner-card:hover::after {
    opacity: 1;
    animation: sfBorderTrace 850ms linear 1 forwards;
}

/* Partner logo stage — fills square card */
.sf-partner-card .sf-logo-stage {
    padding: 12px 12px;
}

.sf-partner-card .sf-logo-stage img {
    width: 92%;
    max-height: 100%;
}

/* ---- Layer 2: Sponsors ---------------------------------- */

.sf-sponsors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 220px));
    justify-content: center;
    gap: 20px;
}

/* The float-wrap-sp is the grid item — square */
[class*="sf-float-wrap-sp--"] {
    min-width: 0;
    aspect-ratio: 1 / 1;
}

.sf-sponsor-card {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    border: 1px solid rgba(45, 140, 255, 0.14);
    padding: 2px;
    cursor: default;
    box-shadow:
        0  3px 12px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    /* Slow-motion hover transition */
    transition:
        transform 0.65s cubic-bezier(0.25, 1, 0.50, 1),
        box-shadow 0.65s ease,
        border-color 0.65s ease;
}

/* Thin blue inner-edge accent */
.sf-sponsor-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px rgba(45, 140, 255, 0.14);
    pointer-events: none;
    z-index: 2;
    transition: box-shadow 0.65s ease;
}

.sf-sponsor-card:hover::before {
    box-shadow: inset 0 0 0 1px rgba(45, 140, 255, 0.32);
}

.sf-sponsor-card:hover {
    transform: scale(1.03) translateY(-3px);
    border-color: rgba(45, 140, 255, 0.28);
    box-shadow:
        0  7px 22px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Animated border trace — single pass on hover */
.sf-sponsor-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 15px;
    background: conic-gradient(
        from var(--sf-angle),
        transparent 0deg,
        rgba(45, 140, 255, 0.80) 50deg,
        rgba(102, 178, 255, 0.65) 100deg,
        transparent 140deg,
        transparent 360deg
    );
    opacity: 0;
    transition: opacity 0.25s ease;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    padding: 1px;
    z-index: 5;
    pointer-events: none;
}

.sf-sponsor-card:hover::after {
    opacity: 1;
    animation: sfBorderTrace 850ms linear 1 forwards;
}

.sf-sponsor-card .sf-card-inner {
    border-radius: 12px;
}

.sf-sponsor-card .sf-logo-stage {
    margin: 10px 10px 0;
    padding: 12px 12px;
    border-radius: 10px;
}

.sf-sponsor-card .sf-logo-stage img {
    width: 88%;
    max-height: 100%;
}

/* ---- Responsive ----------------------------------------- */

@media (max-width: 768px) {
    .sf-section {
        padding: 48px 0 56px;
    }

    .sf-inner {
        gap: 40px;
    }

    /* Stack partners vertically, no rotation */
    .sf-partners {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .sf-partner-card {
        width: min(300px, 100%);
    }

    /* Remove rotation on mobile */
    .sf-partner-card--1,
    .sf-partner-card--2 {
        transform: none;
    }

    .sf-partner-card--1:hover,
    .sf-partner-card--2:hover {
        transform: scale(1.02) translateY(-4px);
    }

    /* Reduced padding on mobile */
    .sf-partner-card .sf-logo-stage {
        padding: 18px 18px;
    }

    .sf-sponsor-card .sf-logo-stage {
        padding: 12px 12px;
    }

    /* Sponsors: force 2 columns */
    .sf-sponsors {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sf-partners {
        gap: 28px;
    }
}
