/* =========================
   TEMPLATE PICKER (ROOT)
========================= */

.fluent-template-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--ms-space-sm);
    align-items: stretch;
}

/* =========================
   OPTION (WRAPPER)
========================= */

.fluent-template-option {
    position: relative;
    display: block;
    height: 100%;
    cursor: pointer;
}

/* =========================
   INPUT (HIDDEN RADIO)
========================= */

.fluent-template-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* =========================
   CARD
========================= */

.fluent-template-card {
    height: 100%;
    min-height: 200px;

    display: flex;
    flex-direction: column;

    transition:
        border var(--ms-motion-fast) var(--ms-ease),
        box-shadow var(--ms-motion-fast) var(--ms-ease),
        transform var(--ms-motion-fast) var(--ms-ease);
}

/* hover */
.fluent-template-option:hover .fluent-template-card {
    border-color: var(--ms-color-primary-hover);
    transform: translateY(-2px);
}

/* =========================
   ACTIVE / SELECTED STATE
   (pakai :has → anti rusak)
========================= */

.fluent-template-option:has(.fluent-template-input:checked) .fluent-template-card {
    border: 2px solid var(--ms-color-primary);
    box-shadow: var(--ms-shadow-8);
}

/* =========================
   CARD BODY (PREVIEW AREA)
========================= */

.fluent-template-card .fluent-card__body {
    flex: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--ms-color-bg-subtle);
    border-top: 1px solid var(--ms-color-border-subtle);
}

/* =========================
   PREVIEW CONTAINER
========================= */

.fluent-template-preview {
    width: 100%;
    height: 140px;

    display: flex;
    flex-direction: column;

    background: var(--ms-color-bg-canvas);
    border: 1px solid var(--ms-color-border-subtle);
    border-radius: var(--ms-radius-sm);

    overflow: hidden;
    box-shadow: var(--ms-shadow-2);
}

/* =========================
   CHECK ICON
========================= */

.fluent-template-check {
    position: absolute;
    top: var(--ms-space-sm);
    right: var(--ms-space-sm);

    display: none;

    width: 24px;
    height: 24px;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--ms-color-bg-canvas);
    color: var(--ms-color-primary);

    box-shadow: var(--ms-shadow-2);
}

/* show check */
.fluent-template-option:has(.fluent-template-input:checked) .fluent-template-check {
    display: flex;
}

/* =========================
   TEMPLATE PREVIEW (LAYOUT)
========================= */

.tpl-preview {
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;
    gap: 6px;

    padding: 6px;

    background: var(--ms-color-bg-canvas);
}

/* HEADER */
.tpl-header {
    height: 16px;
    border-radius: 4px;
    background: var(--ms-color-neutral-300);
}

/* ROW */
.tpl-row {
    display: flex;
    gap: 6px;
    flex: 1;
}

/* MAIN CONTENT */
.tpl-content {
    flex: 1;
    border-radius: 4px;
    background: var(--ms-color-primary-light);

    position: relative;
    overflow: hidden;
}

/* SIDEBAR */
.tpl-sidebar {
    width: 28px;
    border-radius: 4px;
    background: var(--ms-color-neutral-200);
}

/* =========================
   CONTENT DETAIL (FAKE TEXT)
========================= */

.tpl-content::after {
    content: '';

    position: absolute;
    left: 6px;
    right: 6px;
    top: 6px;

    height: 4px;

    border-radius: 2px;
    background: rgba(0,0,0,0.08);

    box-shadow:
        0 8px 0 rgba(0,0,0,0.06),
        0 16px 0 rgba(0,0,0,0.04);
}