/**
 * Mod Cards — Componente visual compartilhado (App Store)
 * Usado em: admin/modulos, tenant/modulos, admin/tenant_modules
 */

/* ── Grid ── */
.mod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

/* ── Card Base ── */
.mod-card {
    background: #1c2434;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: default;
}

/* ── Card Hover (Dark) ── */
.mod-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 12px 40px rgba(0,0,0,0.35),
        0 0 30px var(--mod-glow, rgba(255,255,255,0.06)),
        0 0 60px var(--mod-glow, rgba(255,255,255,0.03));
    border-color: var(--mod-color) !important;
}

/* ── Card Hover (Light) ── */
.theme-light .mod-card {
    background: #ffffff !important;
}
.theme-light .mod-card:hover {
    box-shadow:
        0 12px 40px rgba(0,0,0,0.12),
        0 0 24px var(--mod-glow, rgba(0,0,0,0.04)),
        0 0 50px var(--mod-glow, rgba(0,0,0,0.02));
}

/* ── Imagem Capa ── */
.mod-cover {
    position: relative;
    width: 100%;
    height: 270px;
    overflow: hidden;
    flex-shrink: 0;
}

.mod-cover-img {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease, opacity 0.3s ease;
}
.mod-card:hover .mod-cover-img {
    transform: scale(1.06);
}

.mod-cover-placeholder {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mod-cover-placeholder i {
    font-size: 4rem;
}

/* ── Ícone Flutuante ── */
.mod-icon-float {
    position: absolute;
    bottom: 8px;
    left: 10px;
    width: 30px;
    height: 30px;
    background: rgba(28, 36, 52, 0.9);
    color: #fff;
    font-size: 0.95rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* ── Badges de Status ── */
.mod-status-badges {
    position: absolute;
    bottom: 8px;
    right: 10px;
    display: flex;
    gap: 6px;
    align-items: center;
}
.mod-status-badges .badge {
    font-size: 0.65rem;
}

.mod-status-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mod-status-dot.ativo {
    background: rgba(32, 201, 151, 0.2);
    border: 1px solid rgba(32, 201, 151, 0.5);
    color: #20c997;
}
.mod-status-dot.inativo {
    background: rgba(108, 117, 125, 0.3);
    border: 1px solid rgba(108, 117, 125, 0.5);
    color: #adb5bd;
}

/* ── Conteúdo ── */
.mod-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mod-title {
    font-size: 0.95rem;
    color: #F8F9FA;
    letter-spacing: -0.2px;
    margin-bottom: 6px;
}

.mod-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.mod-slug {
    background-color: #2b3548;
    color: #E0E5EC;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-family: var(--bs-font-monospace);
    font-weight: 500;
}

.mod-meta {
    font-size: 0.7rem;
    color: #8A99AF;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mod-desc {
    font-size: 0.75rem;
    color: #8A99AF;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    font-weight: 400;
}

/* ── Footer (Toggle) ── */
.mod-footer {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.mod-toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.mod-toggle-label.ativo { color: #20c997; }
.mod-toggle-label.inativo { color: #8A99AF; }
.mod-toggle-label.liberado { color: var(--master-accent, #6f42c1); }

.mod-footer .form-check-input {
    width: 2.5em;
    height: 1.3em;
    cursor: pointer;
    margin: 0;
}

/* ── Ações (Hover Reveal) ── */
.mod-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.mod-card:hover .mod-actions {
    opacity: 1;
    transform: translateY(0);
}

.mod-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.85rem;
}
.mod-btn:hover { opacity: 0.8; }

.mod-btn-edit {
    background-color: #4B8FFA;
    color: #0a2d61;
    font-weight: bold;
}

.mod-btn-toggle {
    border: 1px solid rgba(255, 193, 7, 0.4);
    background: transparent;
    color: #FFC107;
}
.mod-btn-toggle:hover { background: rgba(255, 193, 7, 0.1); }

.mod-btn-install {
    border: 1px solid rgba(25, 135, 84, 0.4);
    background: transparent;
    color: #198754;
}
.mod-btn-install:hover { background: rgba(25, 135, 84, 0.1); }

/* ── Light Mode Overrides ── */
.theme-light .mod-title { color: var(--text) !important; }
.theme-light .mod-meta { color: var(--muted) !important; }
.theme-light .mod-slug { background-color: #e9ecf1 !important; color: #3b4963 !important; }
.theme-light .mod-desc { color: var(--muted) !important; }
.theme-light .mod-toggle-label.inativo { color: var(--muted) !important; }
.theme-light .mod-icon-float { background: rgba(255,255,255,0.9); color: var(--text); border-color: var(--border); }
