/* ════════════════════════════════════════════════════════════════════
   Requires Cards — MC Auto Post dependency cards
   Hiển thị các mod/dependency cần thiết cho bài viết
   ════════════════════════════════════════════════════════════════════ */

/* ── Section wrapper ───────────────────────────────────────────────── */
.mcap-requires-section {
    margin: 32px 0;
    padding: 0;
}

.mcap-requires-section h3 {
    position: relative;
    display: inline-block;
    margin: 0 0 18px 0;
    padding: 0 0 8px 0;
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

.mcap-requires-section h3::before {
    content: "⚙";
    margin-right: 8px;
    color: #2271b1;
}

.mcap-requires-section h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2271b1 0%, #46b1e8 100%);
    border-radius: 2px;
}

/* ── Grid container ────────────────────────────────────────────────── */
.mcap-req-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin: 0;
}

/* ── Card base ─────────────────────────────────────────────────────── */
.mcap-req-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.mcap-req-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
    transition: all 0.25s ease;
}

/* ── Linked card (có ThirstyAffiliates link) ───────────────────────── */
.mcap-req-linked {
    text-decoration: none !important;
    color: inherit !important;
    cursor: pointer;
}

.mcap-req-linked::before {
    background: linear-gradient(180deg, #2271b1 0%, #46b1e8 100%);
}

.mcap-req-linked:hover {
    border-color: #2271b1;
    box-shadow: 0 8px 24px rgba(34, 113, 177, 0.18);
    transform: translateY(-2px);
}

.mcap-req-linked:hover::before {
    width: 6px;
}

.mcap-req-linked:hover .mcap-req-icon {
    transform: scale(1.1) rotate(-5deg);
}

.mcap-req-linked:hover .mcap-req-dl {
    background: linear-gradient(135deg, #135e96 0%, #2271b1 100%);
    transform: translateY(2px);
}

/* ── Icon box ──────────────────────────────────────────────────────── */
.mcap-req-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 10px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8);
    transition: transform 0.25s ease;
}

.mcap-req-card:not(.mcap-req-linked) .mcap-req-icon {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    opacity: 0.7;
}

/* ── Info (name + description) ─────────────────────────────────────── */
.mcap-req-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mcap-req-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mcap-req-desc {
    display: block;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mcap-req-card:not(.mcap-req-linked) .mcap-req-name {
    color: #475569;
}

/* ── Download button (tròn xanh) ───────────────────────────────────── */
.mcap-req-dl {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2271b1 0%, #46b1e8 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(34, 113, 177, 0.3);
    transition: all 0.25s ease;
}

/* ── Mobile responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .mcap-req-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .mcap-req-card {
        padding: 14px 16px;
    }
    .mcap-req-icon {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    .mcap-req-name {
        font-size: 14px;
    }
    .mcap-req-dl {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    .mcap-requires-section h3 {
        font-size: 20px;
    }
}

/* ── Dark mode (theo OS preference) ────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .mcap-req-card {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-color: #334155;
    }
    .mcap-req-name { color: #f1f5f9; }
    .mcap-req-desc { color: #94a3b8; }
    .mcap-req-icon {
        background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
    }
    .mcap-req-linked:hover {
        box-shadow: 0 8px 24px rgba(70, 177, 232, 0.25);
    }
    .mcap-requires-section h3 { color: #f1f5f9; }
}
