.template-list-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.template-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    background-color: var(--background-secondary);
}

.template-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.template-list-header h2 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.template-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-circle);
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.template-close-btn:hover {
    background-color: var(--surface-hover);
    color: var(--text-primary);
}

.template-close-btn .icon {
    width: 16px;
    height: 16px;
}

.template-list-actions {
    display: flex;
    gap: var(--space-sm);
}

.template-list-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.template-item {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--surface);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.template-item:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.template-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-right: var(--space-md);
    color: var(--accent);
}

.template-details {
    flex: 1;
    min-width: 0;
}

.template-name {
    margin: 0 0 var(--space-xs) 0;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    font-size: var(--font-size-xs);
    color: transparent;
}

.template-meta span {
    color: var(--text-tertiary);
}

.template-type, .template-size, .template-date {
    display: inline-block;
}

.template-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-left: var(--space-md);
}

.template-list-loading, .template-list-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    text-align: center;
}

.template-list-loading .spinner {
    margin-bottom: var(--space-md);
}

.template-use-form, .template-add-form {
    padding: var(--space-md) 0;
}

/* Icon placeholders */
.icon-x {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
}

/* Add this to your templates.css file */

.template-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background-color: transparent;
    color: var(--text-tertiary);
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.template-delete-btn:hover {
    background-color: var(--surface-hover);
    color: var(--error);
}

.template-delete-btn .icon {
    width: 16px;
    height: 16px;
}

/* Make sure the icon-delete class exists */
.icon-delete {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'%3E%3C/polyline%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'%3E%3C/path%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .template-grid {
        grid-template-columns: 1fr;
    }

    .template-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
        padding: var(--space-md);
    }

    .template-header-left {
        width: 100%;
        justify-content: space-between;
    }

    .template-list-actions {
        width: 100%;
    }

    .template-item {
        flex-direction: column;
        text-align: center;
    }

    .template-details {
        text-align: center;
        margin: var(--space-md) 0;
    }

    .template-actions {
        margin-left: 0;
    }
}