/**
 * STCode Aplicativo Shortcode — Premium Play Store Design
 * Card de aplicativo com botão CTA atrativo, estrelas visuais e stats em badges.
 * Cores fixas (independente do tema). Compatível com browsers modernos.
 */

/* =========================================
   CARD CONTAINER
   ========================================= */
.app-card {
    width: fit-content;
    min-width: 360px;
    max-width: 720px;
    margin: 22px auto;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #0f172a;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}

.app-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

/* =========================================
   HEADER (Logo + Title)
   ========================================= */
.app-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: left;
    gap: 16px;
    padding: 20px 22px 18px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 50%, #ffffff 100%);
    border-bottom: 1px solid #f1f5f9;
}

.app-logo {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    object-fit: cover;
    background: #ffffff;
    flex-shrink: 0;
    box-shadow:
        0 6px 16px rgba(16, 185, 129, 0.2),
        0 0 0 1px rgba(15, 23, 42, 0.04);
}

.app-title-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}

.app-title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.app-category {
    display: inline-block;
    padding: 3px 10px;
    background: #d1fae5;
    color: #065f46;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 999px;
    margin: 0;
    line-height: 1.4;
}

.app-category:empty {
    display: none;
}

/* =========================================
   BODY (Stats + Button)
   ========================================= */
.app-body {
    padding: 18px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Stats row */
.app-stats {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.app-info-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.app-info-item:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

/* Rating pill — accent só no número (amber) */
.app-info-item.rating-item {
    padding: 5px 12px;
}

/* Downloads pill — ícone azul */
.app-info-item.downloads-item .app-info-icon {
    color: #2563eb;
}

/* Size pill — ícone roxo */
.app-info-item.size-item .app-info-icon {
    color: #9333ea;
}

/* SVG icons inside pills */
.app-info-icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.app-info-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* =========================================
   VISUAL STAR RATING (★★★★½)
   ========================================= */
.stc-rating-stars {
    --rating: 0;
    --star-size: 16px;
    position: relative;
    display: inline-block;
    width: calc(var(--star-size) * 5);
    height: var(--star-size);
    flex-shrink: 0;
}

.stc-rating-stars::before,
.stc-rating-stars::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-repeat: repeat-x;
    background-size: var(--star-size) var(--star-size);
}

/* Empty stars (background) */
.stc-rating-stars::before {
    width: 100%;
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fde68a'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
}

/* Filled stars (foreground, width = rating %) */
.stc-rating-stars::after {
    width: calc(var(--rating) / 5 * 100%);
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f59e0b'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
}

.rating-text {
    font-weight: 700;
    color: #b45309;
}

.rating-count {
    color: #64748b;
    font-weight: 500;
}

/* =========================================
   DOWNLOAD BUTTON (CTA — gradient + glow)
   ========================================= */
.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 360px;
    align-self: center;
    padding: 13px 22px;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    background-size: 200% 200%;
    background-position: 0% 50%;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow:
        0 10px 25px rgba(16, 185, 129, 0.32),
        0 4px 10px rgba(6, 182, 212, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-position 0.5s ease;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.download-btn:hover {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    background-position: 100% 50%;
    box-shadow:
        0 14px 32px rgba(16, 185, 129, 0.4),
        0 6px 14px rgba(6, 182, 212, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.download-btn:active {
    transform: translateY(-1px);
    transition-duration: 0.1s;
}

/* Shimmer animation — diagonal light sweep */
.download-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        110deg,
        transparent 30%,
        rgba(255, 255, 255, 0.35) 50%,
        transparent 70%
    );
    transform: skewX(-20deg);
    pointer-events: none;
}

.download-btn:hover::before {
    animation: stc-shimmer 1.1s ease-out;
}

@keyframes stc-shimmer {
    0% { left: -100%; }
    100% { left: 130%; }
}

/* Button icon (Google Play) + arrow */
.download-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.download-btn-icon svg {
    width: 100%;
    height: 100%;
}

.download-btn-text {
    flex: 1;
    text-align: center;
}

.download-btn-arrow {
    display: inline-flex;
    transition: transform 0.25s ease;
}

.download-btn:hover .download-btn-arrow {
    transform: translateX(4px);
}

/* =========================================
   TRUST STRIP (under button)
   ========================================= */
.app-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: -2px;
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
    flex-wrap: wrap;
}

.app-trust span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.app-trust span::before {
    content: "✓";
    color: #10b981;
    font-weight: 700;
}

/* =========================================
   SEPARATOR (legacy, kept for compatibility)
   ========================================= */
.app-separator {
    display: none;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 600px) {
    .app-card {
        width: auto;
        min-width: 0;
        max-width: none;
        margin: 18px 10px;
        border-radius: 24px;
    }

    .app-stats {
        flex-wrap: wrap;
    }

    .app-header {
        padding: 20px;
        gap: 14px;
    }

    .app-logo {
        width: 60px;
        height: 60px;
        border-radius: 15px;
    }

    .app-title {
        font-size: 1.05rem;
        margin-bottom: 6px;
    }

    .app-category {
        font-size: 0.68rem;
        padding: 3px 10px;
    }

    .app-body {
        padding: 18px 20px 20px;
        gap: 16px;
    }

    .app-stats {
        gap: 8px;
    }

    .app-info-item {
        padding: 7px 12px;
        font-size: 0.78rem;
    }

    .stc-rating-stars {
        --star-size: 14px;
    }

    .download-btn {
        padding: 15px 20px;
        font-size: 0.95rem;
        letter-spacing: 0.04em;
        gap: 10px;
    }

    .app-trust {
        font-size: 0.72rem;
        gap: 10px;
    }
}

@media (max-width: 380px) {
    .app-card {
        border-radius: 22px;
    }

    .app-header {
        padding: 18px;
    }

    .app-logo {
        width: 54px;
        height: 54px;
        border-radius: 13px;
    }

    .app-body {
        padding: 16px 18px 18px;
    }

    .download-btn {
        font-size: 0.85rem;
        padding: 14px 16px;
    }
}

/* =========================================
   ACCESSIBILITY
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    .app-card,
    .download-btn,
    .download-btn-arrow {
        transition: none;
    }

    .download-btn:hover::before {
        animation: none;
    }
}

.download-btn:focus-visible {
    outline: 3px solid #06b6d4;
    outline-offset: 3px;
}
