/* ── Feature Boxes Widget ─────────────────────────────────────── */

.fb-widget {
    width: 100%;
}

.fb-grid {
    display: grid;
    gap: 24px;
}

@media (max-width: 1024px) {
    .fb-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    .fb-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── Base Card ────────────────────────────────────────────────── */

.fb-card {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 32px;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease;
    cursor: default;
}

/* Accent stripe – top left bar */
.fb-accent-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #6c63ff;
    border-radius: 4px 0 0 4px;
    transition: width 0.35s ease;
}

/* Decorative large number */
.fb-number {
    position: absolute;
    top: -14px;
    right: 20px;
    font-size: 96px;
    font-weight: 900;
    line-height: 1;
    color: #6c63ff;
    opacity: 0.07;
    pointer-events: none;
    font-family: inherit;
    transition: opacity 0.35s ease, transform 0.35s ease;
    user-select: none;
}

/* Icon box */
.fb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: rgba(108, 99, 255, 0.1);
    color: #6c63ff;
    margin-bottom: 20px;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease;
}

.fb-icon i,
.fb-icon svg {
    font-size: 28px;
    width: 28px;
    transition: transform 0.3s ease;
}

.fb-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: #1a1a2e;
    line-height: 1.3;
}

.fb-desc {
    font-size: 0.93rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.65;
}

/* ── Style: Tilted ────────────────────────────────────────────── */

.fb-card.style-tilted {
    transform: rotate(-1.5deg) translateY(0);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.fb-card.style-tilted:nth-child(even) {
    transform: rotate(1.2deg) translateY(0);
}

.fb-card.style-tilted:hover {
    transform: rotate(0deg) translateY(-6px) !important;
    box-shadow: 0 24px 60px rgba(108, 99, 255, 0.18);
}

.fb-card.style-tilted:hover .fb-number {
    opacity: 0.12;
    transform: translateY(-6px) scale(1.05);
}

.fb-card.style-tilted:hover .fb-icon {
    transform: scale(1.12) rotate(-4deg);
}

.fb-card.style-tilted:hover .fb-accent-line {
    width: 6px;
}

/* ── Style: Float ─────────────────────────────────────────────── */

.fb-card.style-float {
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

.fb-card.style-float:hover {
    transform: translateY(-12px);
    box-shadow: 0 28px 64px rgba(108, 99, 255, 0.2);
}

.fb-card.style-float:hover .fb-number {
    opacity: 0.11;
    transform: scale(1.04);
}

.fb-card.style-float:hover .fb-icon {
    transform: scale(1.1);
}

.fb-card.style-float:hover .fb-accent-line {
    width: 8px;
}

/* ── Style: Spotlight ─────────────────────────────────────────── */

.fb-card.style-spotlight {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

/* Sliding diagonal highlight on hover */
.fb-card.style-spotlight::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #6c63ff;
    opacity: 0;
    clip-path: polygon(0 0, 30% 0, 0 30%);
    transition: opacity 0.4s ease, clip-path 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    border-radius: inherit;
}

.fb-card.style-spotlight:hover::after {
    opacity: 0.08;
    clip-path: polygon(0 0, 110% 0, 0 110%);
}

.fb-card.style-spotlight:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(108, 99, 255, 0.15);
}

.fb-card.style-spotlight:hover .fb-number {
    opacity: 0.1;
}

.fb-card.style-spotlight:hover .fb-icon {
    transform: scale(1.08);
}

.fb-card.style-spotlight:hover .fb-accent-line {
    width: 100%;
    height: 4px;
    top: 0;
    left: 0;
    border-radius: 4px 4px 0 0;
    transition: width 0.5s ease, height 0s;
}

/* ── Style: Neon Pulse ────────────────────────────────────────── */
/*
 * Uses the "inner-mask" rotating border trick:
 *   ::before  = huge conic-gradient comet, clips to card bounds
 *   ::after   = dark fill starting at inset:2px, masks the interior
 *   > *       = content above both layers via z-index
 */

.fb-card.style-neon {
    background: transparent;
    border: none;
    isolation: isolate;
    box-shadow: none;
}

/* Rotating comet border — centered so it spins around the card's midpoint */
.fb-card.style-neon::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        transparent 35%,
        var(--fb-accent, #6c63ff) 50%,
        transparent 65%,
        transparent 100%
    );
    z-index: -2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Dark inner fill — reveals only the 2px border ring */
.fb-card.style-neon::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: #080810;
    border-radius: 14px; /* card default 16px - 2px */
    z-index: -1;
    pointer-events: none;
}

/* Lift all content above the pseudo-element layers */
.fb-card.style-neon > * {
    position: relative;
    z-index: 0;
}

.fb-card.style-neon .fb-accent-line { display: none; }
.fb-card.style-neon .fb-title       { color: #dddaf8; }
.fb-card.style-neon .fb-desc        { color: #7878a0; }
.fb-card.style-neon .fb-number      { color: #ffffff; opacity: 0.03; font-size: 110px; }
.fb-card.style-neon .fb-icon        { background: rgba(108, 99, 255, 0.12); }

.fb-card.style-neon:hover::before {
    opacity: 1;
    animation: fb-neon-spin 2.2s linear infinite;
}

.fb-card.style-neon:hover {
    transform: translateY(-4px);
}

.fb-card.style-neon:hover .fb-number { opacity: 0.05; }
.fb-card.style-neon:hover .fb-icon   { transform: scale(1.1); }

@keyframes fb-neon-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Style: Glass Chip ────────────────────────────────────────── */
/*
 * Frosted glass card — works best placed on a non-white section background.
 * ::before = iridescent shimmer sweep on hover
 * ::after  = accent triangle chip clipped to top-right corner
 */

.fb-card.style-glass {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Prismatic shimmer layer */
.fb-card.style-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        transparent 20%,
        rgba(255, 255, 255, 0.12) 40%,
        rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0.12) 60%,
        transparent 80%
    );
    background-size: 250% 100%;
    background-position: 150% 0;
    opacity: 0;
    transition: opacity 0.3s ease, background-position 0.65s ease;
    pointer-events: none;
    border-radius: inherit;
}

.fb-card.style-glass:hover::before {
    opacity: 1;
    background-position: -50% 0;
}

/* Accent corner chip */
.fb-card.style-glass::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 52px;
    background: linear-gradient(225deg, var(--fb-accent, #6c63ff) 50%, transparent 50%);
    border-radius: 0 16px 0 0;
    opacity: 0.75;
    pointer-events: none;
    transition: opacity 0.3s ease, width 0.3s ease, height 0.3s ease;
}

.fb-card.style-glass:hover {
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18),
                inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transform: translateY(-6px);
}

.fb-card.style-glass:hover::after {
    width: 64px;
    height: 64px;
    opacity: 1;
}

.fb-card.style-glass .fb-title { color: #f0f0ff; }
.fb-card.style-glass .fb-desc  { color: rgba(255, 255, 255, 0.62); }
.fb-card.style-glass .fb-icon  {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.fb-card.style-glass .fb-number { color: #ffffff; opacity: 0.06; }
.fb-card.style-glass .fb-accent-line { background: rgba(255, 255, 255, 0.35); width: 3px; }

.fb-card.style-glass:hover .fb-icon  { transform: scale(1.1); }
.fb-card.style-glass:hover .fb-number { opacity: 0.1; }
.fb-card.style-glass:hover .fb-accent-line { width: 5px; }

/* ── Style: Terminal ──────────────────────────────────────────── */
/*
 * Styled as a VS Code / terminal window.
 * DOM: .fb-terminal-header with 3 colored dots + path label (added in PHP).
 * ::before = scanline that sweeps down on hover
 */

.fb-card.style-terminal {
    background: #13131f;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding-top: 54px; /* room for the header bar */
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

/* Scanline sweep */
.fb-card.style-terminal::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 72px;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--fb-accent, rgba(108, 99, 255, 0.12)),
        transparent
    );
    top: -72px;
    pointer-events: none;
    z-index: 1;
}

.fb-card.style-terminal:hover::before {
    animation: fb-scanline 1.3s ease-in 0.05s forwards;
}

@keyframes fb-scanline {
    0%   { top: 38px; opacity: 1; }
    85%  { opacity: 0.7; }
    100% { top: calc(100% + 72px); opacity: 0; }
}

/* Terminal header bar */
.fb-terminal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 38px;
    background: #1e1e2e;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 7px;
    z-index: 2;
}

.fb-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}

.fb-dot-r { background: #ff5f56; }
.fb-dot-y { background: #ffbd2e; }
.fb-dot-g { background: #27c93f; }

.fb-terminal-path {
    margin-left: 8px;
    font-family: 'Courier New', 'Menlo', 'Monaco', monospace;
    font-size: 11px;
    color: #6c63ff;
    opacity: 0.8;
    letter-spacing: 0.03em;
}

/* Blinking cursor after title */
.fb-card.style-terminal .fb-title::after {
    content: '|';
    display: inline-block;
    margin-left: 3px;
    color: var(--fb-accent, #6c63ff);
    font-weight: 300;
    animation: fb-cursor 1.1s step-end infinite;
}

@keyframes fb-cursor {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.fb-card.style-terminal .fb-title { color: #e0e0f8; }
.fb-card.style-terminal .fb-desc  {
    color: #6a6a8a;
    font-family: 'Courier New', 'Menlo', monospace;
    font-size: 0.86rem;
    line-height: 1.7;
}
.fb-card.style-terminal .fb-icon {
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: 8px;
}
.fb-card.style-terminal .fb-accent-line { display: none; }

.fb-card.style-terminal:hover {
    border-color: rgba(255, 255, 255, 0.13);
    box-shadow: 0 16px 52px rgba(0, 0, 0, 0.55);
    transform: translateY(-4px);
}

.fb-card.style-terminal:hover .fb-icon { transform: scale(1.08); }

/* ── Style: Split Panel ───────────────────────────────────────── */
/*
 * A narrow accent-colored left rail holds the icon (and optional step number).
 * The right side is clean white with the title and description.
 * Rail width expands slightly on hover.
 */

.fb-card.style-split {
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: #ffffff;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
    transition: transform 0.32s ease, box-shadow 0.32s ease;
}

.fb-split-left {
    width: 80px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 0;
    background: #6c63ff; /* overridden per-card */
    transition: width 0.32s ease;
    position: relative;
}

/* Step number inside the rail */
.fb-split-left .fb-number {
    position: static;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.45);
    opacity: 1;
    order: -1; /* number above icon */
}

.fb-split-left .fb-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    margin: 0;
    transition: transform 0.3s ease, background 0.3s ease;
}

.fb-split-right {
    flex: 1;
    padding: 28px 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* prevent text overflow */
}

.fb-split-right .fb-title { margin: 0 0 8px; }
.fb-split-right .fb-desc  { margin: 0; }

.fb-card.style-split:hover {
    transform: translateY(-5px);
}

.fb-card.style-split:hover .fb-split-left {
    width: 96px;
}

.fb-card.style-split:hover .fb-icon {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.25);
}

/* ── Style: Depth Stack ───────────────────────────────────────── */
/*
 * Two accent-colored "ghost" cards sit offset behind the main card,
 * simulated with a layered box-shadow (no z-index tricks, fully reliable).
 * On hover the stack fans out further as the main card shifts left-up.
 */

.fb-card.style-stack {
    background: #ffffff;
    /* base box-shadow set per-card via PHP dynamic CSS */
    transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.38s ease;
}

.fb-card.style-stack:hover {
    transform: translate(-5px, -7px);
}

.fb-card.style-stack:hover .fb-icon {
    transform: scale(1.1) rotate(-3deg);
}

.fb-card.style-stack:hover .fb-number {
    opacity: 0.11;
    transform: translateY(-4px);
}

.fb-card.style-stack:hover .fb-accent-line {
    width: 6px;
}

/* ── Style: Outline Bloom ─────────────────────────────────────── */
/*
 * Card starts as a clean outlined frame — no background fill at all.
 * On hover a soft radial gradient blooms from the icon area inward.
 * The icon switches from outlined circle to subtly filled.
 */

.fb-card.style-bloom {
    background: transparent;
    border: 2px solid #6c63ff; /* overridden per-card */
    box-shadow: none;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.fb-card.style-bloom .fb-accent-line { display: none; }

.fb-card.style-bloom .fb-icon {
    background: transparent;
    border: 2px solid currentColor;
    border-radius: 50%;
}

/* Radial gradient that blooms from icon area on hover */
.fb-card.style-bloom::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        ellipse 90% 80% at 50% 25%,
        var(--fb-accent, #6c63ff),
        transparent
    );
    opacity: 0;
    transition: opacity 0.55s ease;
    pointer-events: none;
}

.fb-card.style-bloom:hover::before {
    opacity: 0.09;
}

.fb-card.style-bloom:hover {
    transform: translateY(-5px);
}

.fb-card.style-bloom:hover .fb-icon {
    background: rgba(108, 99, 255, 0.08);
    transform: scale(1.1);
}

.fb-card.style-bloom:hover .fb-number {
    opacity: 0.09;
}

/* ── Style: Ruled ─────────────────────────────────────────────── */
/*
 * Zero card box — just a 3px top accent border on a clean surface.
 * The step number becomes a proper visible label ("01", "02"...).
 * On hover the card slides right 4px and a line draws under the title.
 * Best in a light section where the grid gap acts as natural separation.
 */

.fb-card.style-ruled {
    background: transparent;
    border: none;
    border-top: 3px solid #6c63ff; /* overridden per-card */
    border-radius: 0;
    box-shadow: none;
    padding: 24px 8px 24px 4px;
    transition: transform 0.3s ease;
}

.fb-card.style-ruled .fb-accent-line { display: none; }

/* Step number as a real label, not a watermark */
.fb-card.style-ruled .fb-number {
    position: static;
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6c63ff; /* overridden per-card */
    opacity: 1;
    margin-bottom: 14px;
    line-height: 1;
}

.fb-card.style-ruled .fb-icon {
    margin-bottom: 18px;
    border-radius: 10px;
}

/* Drawing underline on title */
.fb-card.style-ruled .fb-title {
    display: inline;
    position: relative;
}

.fb-card.style-ruled .fb-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #6c63ff; /* overridden per-card */
    transition: width 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.fb-card.style-ruled:hover {
    transform: translateX(5px);
}

.fb-card.style-ruled:hover .fb-title::after {
    width: 100%;
}

.fb-card.style-ruled:hover .fb-icon {
    transform: scale(1.08) rotate(-5deg);
}

/* ── RTL support ──────────────────────────────────────────────── */

[dir="rtl"] .fb-accent-line,
.rtl .fb-accent-line {
    left: auto;
    right: 0;
    border-radius: 0 4px 4px 0;
}

[dir="rtl"] .fb-number,
.rtl .fb-number {
    right: auto;
    left: 20px;
}
