/* =============================================
   PRAXISMED DESIGN SYSTEM
   Componente: Feature Card
   Versão 1.1 | Inspiração: iPadOS / visionOS
   ============================================= */

/* ──────────────────────────────────────────────
   DESIGN TOKENS — Feature Card
   ────────────────────────────────────────────── */
:root {
    /* Card Dimensions */
    --ds-card-width: 420px;
    --ds-card-height: 260px;
    --ds-card-radius: 28px;

    /* Card Colors — Light Mode */
    --ds-card-bg: rgba(255, 255, 255, 0.72);
    --ds-card-border: rgba(255, 255, 255, 0.5);
    --ds-card-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 8px 16px rgba(0, 0, 0, 0.04),
        0 24px 48px rgba(0, 0, 0, 0.06);
    --ds-card-shadow-hover: 
        0 4px 8px rgba(0, 0, 0, 0.03),
        0 16px 32px rgba(0, 0, 0, 0.06),
        0 48px 80px rgba(0, 0, 0, 0.10);

    /* Glass Effect */
    --ds-glass-blur: 20px;
    --ds-glass-saturate: 1.8;

    /* Border Glow */
    --ds-glow-opacity: 0;
    --ds-glow-color: 109, 40, 217;

    /* Typography */
    --ds-font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
    --ds-font-weight-badge: 600;
    --ds-font-weight-title: 700;
    --ds-font-weight-desc: 400;
    --ds-font-weight-btn: 600;

    /* Colors — Content */
    --ds-text-primary: #1d1d1f;
    --ds-text-secondary: #6e6e73;
    --ds-badge-bg: rgba(109, 40, 217, 0.08);
    --ds-badge-color: #6d28d9;
    --ds-btn-bg-start: #1d1d1f;
    --ds-btn-bg-end: #2d2d30;
    --ds-btn-color: #ffffff;
    --ds-btn-hover-bg-start: #333336;
    --ds-btn-hover-bg-end: #3d3d40;
    --ds-btn-shadow: 0 2px 4px rgba(0,0,0,0.08);

    /* Illustration Colors */
    --ds-illust-primary: #6d28d9;
    --ds-illust-secondary: #a78bfa;
    --ds-illust-tertiary: #ede9fe;
    --ds-illust-accent: #5ab4e0;

    /* Illustration Glow */
    --ds-illust-glow-color: rgba(109, 40, 217, 0.10);

    /* Transitions */
    --ds-transition-fast: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    --ds-transition-smooth: 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Dark Mode Tokens */
body.dark-mode {
    --ds-card-bg: rgba(30, 32, 50, 0.72);
    --ds-card-border: rgba(255, 255, 255, 0.08);
    --ds-card-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.12),
        0 24px 48px rgba(0, 0, 0, 0.20);
    --ds-card-shadow-hover: 
        0 4px 8px rgba(0, 0, 0, 0.10),
        0 16px 32px rgba(0, 0, 0, 0.16),
        0 48px 80px rgba(0, 0, 0, 0.30);

    --ds-text-primary: #f5f5f7;
    --ds-text-secondary: #a1a1a6;
    --ds-badge-bg: rgba(167, 139, 250, 0.15);
    --ds-badge-color: #a78bfa;
    --ds-btn-bg-start: #f5f5f7;
    --ds-btn-bg-end: #e8e8ed;
    --ds-btn-color: #1d1d1f;
    --ds-btn-hover-bg-start: #ffffff;
    --ds-btn-hover-bg-end: #f0f0f5;
    --ds-btn-shadow: 0 2px 4px rgba(0,0,0,0.12);

    --ds-illust-primary: #a78bfa;
    --ds-illust-secondary: #6d28d9;
    --ds-illust-tertiary: rgba(109, 40, 217, 0.2);
    --ds-illust-glow-color: rgba(167, 139, 250, 0.08);
}

/* ──────────────────────────────────────────────
   FEATURE CARD — Base
   ────────────────────────────────────────────── */
.feature-card {
    position: relative;
    width: var(--ds-card-width);
    height: var(--ds-card-height);
    border-radius: var(--ds-card-radius);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

/* Outer glow layer — thin border illumination */
.feature-card__glow {
    position: absolute;
    inset: 0;
    border-radius: var(--ds-card-radius);
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.4) 100%
    );
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: var(--ds-glow-opacity);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
    pointer-events: none;
    z-index: 2;
}

.feature-card__glow::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: calc(var(--ds-card-radius) + 3px);
    background: radial-gradient(
        ellipse at 20% 0%,
        rgba(var(--ds-glow-color), 0.12) 0%,
        transparent 55%
    );
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
    pointer-events: none;
}

/* Inner card surface */
.feature-card__inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--ds-card-radius);
    background: var(--ds-card-bg);
    backdrop-filter: blur(var(--ds-glass-blur)) saturate(var(--ds-glass-saturate));
    -webkit-backdrop-filter: blur(var(--ds-glass-blur)) saturate(var(--ds-glass-saturate));
    border: 1px solid var(--ds-card-border);
    box-shadow: var(--ds-card-shadow);
    overflow: hidden;
    display: flex;
    transition: 
        transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
        box-shadow 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 1;
}

/* Subtle inner highlight — top edge light */
.feature-card__inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.8) 50%,
        transparent 100%
    );
    z-index: 3;
    pointer-events: none;
}

/* Ambient light — soft glow on top-left */
.feature-card__inner::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -30%;
    width: 80%;
    height: 100%;
    background: radial-gradient(
        ellipse at 30% 40%,
        rgba(var(--ds-glow-color), 0.05) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ──────────────────────────────────────────────
   FEATURE CARD — Content Layout
   ────────────────────────────────────────────── */
.feature-card__content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 32px 28px 32px;
    width: 58%;
    z-index: 1;
    gap: 0;
}

.feature-card__badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--ds-badge-bg);
    color: var(--ds-badge-color);
    font-family: var(--ds-font-family);
    font-size: 0.65rem;
    font-weight: var(--ds-font-weight-badge);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 14px;
    line-height: 1.6;
    backdrop-filter: blur(4px);
}

.feature-card__title {
    font-family: var(--ds-font-family);
    font-size: 1.45rem;
    font-weight: var(--ds-font-weight-title);
    color: var(--ds-text-primary);
    line-height: 1.2;
    margin: 0 0 10px 0;
    letter-spacing: -0.025em;
}

.feature-card__description {
    font-family: var(--ds-font-family);
    font-size: 0.82rem;
    font-weight: var(--ds-font-weight-desc);
    color: var(--ds-text-secondary);
    line-height: 1.6;
    margin: 0 0 22px 0;
    flex: 1;
}

.feature-card__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 10px 22px;
    border-radius: 100px;
    background: linear-gradient(
        135deg,
        var(--ds-btn-bg-start) 0%,
        var(--ds-btn-bg-end) 100%
    );
    color: var(--ds-btn-color);
    border: none;
    font-family: var(--ds-font-family);
    font-size: 0.78rem;
    font-weight: var(--ds-font-weight-btn);
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: var(--ds-btn-shadow);
    transition: 
        transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
        box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    position: relative;
    overflow: hidden;
}

/* Botão — inner shine gradient */
.feature-card__button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.04) 40%,
        transparent 60%
    );
    pointer-events: none;
}

/* Botão — bottom edge subtle highlight */
.feature-card__button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    pointer-events: none;
}

.feature-card__button svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ──────────────────────────────────────────────
   FEATURE CARD — Illustration Area
   ────────────────────────────────────────────── */
.feature-card__illustration {
    position: absolute;
    right: -8px;
    top: 0;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow: visible;
    pointer-events: none;
}

/* Radial glow behind the illustration */
.feature-card__illustration::before {
    content: '';
    position: absolute;
    right: 0;
    top: 5%;
    width: 90%;
    height: 90%;
    background: radial-gradient(
        ellipse at 60% 50%,
        var(--ds-illust-glow-color) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.5s ease;
}

.feature-card__illustration svg {
    position: relative;
    width: 100%;
    height: 85%;
    z-index: 1;
    transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    transform-origin: center center;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.04));
}

/* ──────────────────────────────────────────────
   FEATURE CARD — Hover States
   ────────────────────────────────────────────── */
.feature-card:hover .feature-card__inner {
    transform: translateY(-6px) scale(1.012);
    box-shadow: var(--ds-card-shadow-hover);
}

.feature-card:hover .feature-card__glow {
    --ds-glow-opacity: 1;
    opacity: 1;
}

.feature-card:hover .feature-card__glow::after {
    opacity: 1;
}

.feature-card:hover .feature-card__inner::after {
    opacity: 1.5;
}

.feature-card:hover .feature-card__illustration svg {
    transform: scale(1.05);
    filter: drop-shadow(0 12px 28px rgba(0,0,0,0.06));
}

.feature-card:hover .feature-card__button {
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.feature-card:hover .feature-card__button svg {
    transform: translateX(2px);
}

.feature-card:active .feature-card__inner {
    transform: translateY(-2px) scale(1.004);
    transition-duration: 0.15s;
}

/* ──────────────────────────────────────────────
   FEATURE CARD — Variations
   ────────────────────────────────────────────── */

/* Treinamento — Verde */
.feature-card--treinamento {
    --ds-glow-color: 16, 185, 129;
    --ds-badge-bg: rgba(16, 185, 129, 0.08);
    --ds-badge-color: #059669;
    --ds-illust-primary: #059669;
    --ds-illust-secondary: #34d399;
    --ds-illust-tertiary: #d1fae5;
    --ds-illust-glow-color: rgba(16, 185, 129, 0.08);
}
body.dark-mode .feature-card--treinamento {
    --ds-badge-bg: rgba(52, 211, 153, 0.15);
    --ds-badge-color: #34d399;
    --ds-illust-primary: #34d399;
    --ds-illust-secondary: #059669;
    --ds-illust-tertiary: rgba(16, 185, 129, 0.2);
    --ds-illust-glow-color: rgba(52, 211, 153, 0.06);
}

/* Simulação — Roxo */
.feature-card--simulacao {
    --ds-glow-color: 109, 40, 217;
    --ds-badge-bg: rgba(109, 40, 217, 0.08);
    --ds-badge-color: #6d28d9;
    --ds-illust-primary: #6d28d9;
    --ds-illust-secondary: #a78bfa;
    --ds-illust-tertiary: #ede9fe;
    --ds-illust-glow-color: rgba(109, 40, 217, 0.08);
}
body.dark-mode .feature-card--simulacao {
    --ds-badge-bg: rgba(167, 139, 250, 0.15);
    --ds-badge-color: #a78bfa;
    --ds-illust-primary: #a78bfa;
    --ds-illust-secondary: #6d28d9;
    --ds-illust-tertiary: rgba(109, 40, 217, 0.2);
    --ds-illust-glow-color: rgba(167, 139, 250, 0.06);
}

/* Colaborativo — Azul */
.feature-card--colaborativo {
    --ds-glow-color: 59, 130, 246;
    --ds-badge-bg: rgba(59, 130, 246, 0.08);
    --ds-badge-color: #2563eb;
    --ds-illust-primary: #2563eb;
    --ds-illust-secondary: #60a5fa;
    --ds-illust-tertiary: #dbeafe;
    --ds-illust-glow-color: rgba(59, 130, 246, 0.08);
}
body.dark-mode .feature-card--colaborativo {
    --ds-badge-bg: rgba(96, 165, 250, 0.15);
    --ds-badge-color: #60a5fa;
    --ds-illust-primary: #60a5fa;
    --ds-illust-secondary: #2563eb;
    --ds-illust-tertiary: rgba(59, 130, 246, 0.2);
    --ds-illust-glow-color: rgba(96, 165, 250, 0.06);
}

/* IA / Avaliação — Âmbar */
.feature-card--ia {
    --ds-glow-color: 245, 158, 11;
    --ds-badge-bg: rgba(245, 158, 11, 0.08);
    --ds-badge-color: #d97706;
    --ds-illust-primary: #d97706;
    --ds-illust-secondary: #fbbf24;
    --ds-illust-tertiary: #fef3c7;
    --ds-illust-glow-color: rgba(245, 158, 11, 0.08);
}
body.dark-mode .feature-card--ia {
    --ds-badge-bg: rgba(251, 191, 36, 0.15);
    --ds-badge-color: #fbbf24;
    --ds-illust-primary: #fbbf24;
    --ds-illust-secondary: #d97706;
    --ds-illust-tertiary: rgba(245, 158, 11, 0.2);
    --ds-illust-glow-color: rgba(251, 191, 36, 0.06);
}

/* ──────────────────────────────────────────────
   FEATURE CARD — Responsive
   ────────────────────────────────────────────── */
@media (max-width: 480px) {
    .feature-card {
        width: 100%;
        height: auto;
        aspect-ratio: 420 / 260;
    }
}

/* ──────────────────────────────────────────────
   FEATURE CARD — Reduced Motion
   ────────────────────────────────────────────── */
/* ──────────────────────────────────────────────
   GRID — ds-showcase (compact cards)
   ────────────────────────────────────────────── */
.ds-showcase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ds-showcase .feature-card {
    width: 100%;
    height: 210px;
}

.ds-showcase .feature-card__content {
    padding: 20px 22px 18px 22px;
    width: 56%;
}

.ds-showcase .feature-card__badge {
    padding: 3px 10px;
    font-size: 0.58rem;
    margin-bottom: 10px;
}

.ds-showcase .feature-card__title {
    font-size: 1.15rem;
    margin: 0 0 8px 0;
}

.ds-showcase .feature-card__description {
    font-size: 0.72rem;
    margin: 0 0 14px 0;
    line-height: 1.5;
}

.ds-showcase .feature-card__button {
    padding: 7px 16px;
    font-size: 0.7rem;
    gap: 6px;
}

.ds-showcase .feature-card__button svg {
    width: 14px;
    height: 14px;
}

.ds-showcase .feature-card__illustration {
    transform: scale(0.7);
    transform-origin: center center;
}

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

@media (max-width: 700px) {
    .ds-showcase {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .feature-card__inner,
    .feature-card__glow,
    .feature-card__glow::after,
    .feature-card__illustration svg,
    .feature-card__button,
    .feature-card__button svg {
        transition: none;
    }
}
