/* ==============================================
   PR4 - Template Browser
   Navigateur de modeles dans l'onglet Fichiers
   ============================================== */

/* Category group */
.tpl-category {
    margin-bottom: 20px;
}

.tpl-category:last-child {
    margin-bottom: 20px;
}

/* Category header (reprend pattern .inbox-group-header) */
.tpl-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    margin-bottom: 8px;
}

.tpl-category-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tpl-category-icon svg {
    width: 18px;
    height: 18px;
}

.tpl-category-label {
    font-family: 'Calibri', Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #1A1A1A);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    flex: 1;
}

.tpl-category-count {
    font-size: 12px;
    color: var(--text-secondary, #666666);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
    font-family: 'Calibri', Arial, sans-serif;
    font-weight: 600;
}

/* Template cards grid - 1 colonne */
.tpl-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

/* Individual template card */
.tpl-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius, 12px);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    font-family: 'Calibri', Arial, sans-serif;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tpl-card:hover {
    border-color: var(--primary-color, #1260A8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    transform: translateY(-1px);
}

.tpl-card:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Loading state */
.tpl-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.tpl-card.loading .tpl-card-icon {
    animation: tplPulse 1s ease-in-out infinite;
}

/* Card icon */
.tpl-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tpl-card-icon svg {
    width: 20px;
    height: 20px;
}

/* Card text */
.tpl-card-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tpl-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1A1A1A);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.tpl-card-desc {
    font-size: 11px;
    color: var(--text-secondary, #666666);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Action indicator - toujours visible */
.tpl-card-dl {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary, #666666);
    transition: color 0.2s;
}

.tpl-card:hover .tpl-card-dl {
    color: var(--primary-color, #1260A8);
}

.tpl-card-dl svg {
    width: 16px;
    height: 16px;
}

/* Empty search state */
.tpl-empty-search {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary, #666666);
    font-family: 'Calibri', Arial, sans-serif;
}

.tpl-empty-search svg {
    width: 48px;
    height: 48px;
    color: var(--text-secondary, #666666);
    opacity: 0.3;
    margin-bottom: 12px;
}

.tpl-empty-search p {
    font-size: 14px;
    margin: 0;
}

/* Pulse animation */
@keyframes tplPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Responsive mobile - 1 colonne */
@media (max-width: 480px) {
    .tpl-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .tpl-card {
        padding: 10px 12px;
    }

    .tpl-card-icon {
        width: 36px;
        height: 36px;
    }

    .tpl-card-icon svg {
        width: 18px;
        height: 18px;
    }

    .tpl-card-dl {
        opacity: 1;
    }

    .tpl-category-icon {
        width: 28px;
        height: 28px;
    }

    .tpl-category-icon svg {
        width: 16px;
        height: 16px;
    }
}
